/* Defined inside RPG::MusicManager... */
FSOUND_STREAM *m_MusicData; /* Pointer to stream (duh) */
bool RPG::MusicManager::Create(const char *p_FileName, int p_Volume, int p_Loop)
{
if((p_FileName == NULL) || (p_Volume < 0)) { return(false); }
if(m_MusicData != NULL) { FSOUND_Stream_Close(m_MusicData); m_MusicData = NULL; }
m_MusicData = FSOUND_Stream_Open(p_FileName, 0, 0, 0);
if(m_MusicData == NULL) { return(false); }
FSOUND_Stream_SetLoopCount(m_MusicData, p_Loop);
FSOUND_Stream_Play(0, m_MusicData);
FSOUND_SetVolumeAbsolute(0, p_Volume);
return(true);
}
FSOUND_STREAM looping
The answer to this question must be obvious, but I can't seem to get my music to loop when played as a FSOUND_STREAM...
The music only plays once, despite specifying p_Loop to be -1 when I call the function. What's the problem? Any other suggestions are welcome as well.
Thanks in advance.
According to this, what you're doing seems right. There is an alternative, however
Best of luck!
-jouley
Quote:FSOUND_Stream_SetLoopCountGiven that a whirl? Do other numbers of loop count work? What's the return value when you pass in -1 as opposed to 1?
Sets the stream to loop the number of times specified by the user. If not called it loops forever.
Best of luck!
-jouley
Tried passing -1, 1, and a bunch of other numbers (positive and negative), NOT calling the function, and still nothing... The music only plays once and then stops. The call to FSOUND_Stream_SetLoopCount() always returns true though.
Any other ideas? Would FSOUND_Stream_SetLoopPoints() help me out in any way (and if so, how can I specify something in "PCM SAMPLES")?
Any other ideas? Would FSOUND_Stream_SetLoopPoints() help me out in any way (and if so, how can I specify something in "PCM SAMPLES")?
Solved!! I never specified the FSOUND_LOOP_NORMAL flag in the "mode" parameter for FSOUND_Stream_Open(). The looping mode is probably set to FSOUND_LOOP_OFF by default.
For anyone who's interested...
For anyone who's interested...
m_MusicData = FSOUND_Stream_Open(p_FileName, FSOUND_LOOP_NORMAL, 0, 0);/* Instead of FSOUND_Stream_Open(p_FileName, 0, 0, 0) */
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement