0
0

I would like to write an application that play some short sounds or humain voice instructions to the user. This is for about 0.5 to 10 sec each.

I downloaded FMOD 3.71 to test it on the iPAQ h2210 with Pocket PC 2003. However, I got a freezing sound when it finish to play the first sound. My application still running after but without sound. The trouble seem appear when I call the FSOUND_Close(); inside my callback function.

[code:2w37x23p]
// *******************************
signed char F_CALLBACKAPI MyStreamCallback(FSOUND_STREAM *stream,void *buff,int len,int param) {
if (stream!=NULL) FSOUND_Stream_Close(stream);
FSOUND_Close();
}

// ********************************
void play_mp3_sound(void) {
FSOUND_STREAM *Snd=NULL;
// MP3Size is the size of my MP3Sound2 file on disk that I put in RAM
.
.
if (!FSOUND_Init(22050,32,FSOUND_INIT_GLOBALFOCUS)) return;
Snd = FSOUND_Stream_Open(&MP3Sound2, FSOUND_2D | FSOUND_LOADMEMORY | FSOUND_MPEGACCURATE,0,MP3Size);
if (FSOUND_Stream_SetEndCallback(Snd,MyStreamCallback,0)==TRUE)
{
soundChannel=FSOUND_Stream_Play(FSOUND_FREE,Snd);
}
}
[/code:2w37x23p]

I do not understand what I’m not doing right? Also it is better to call the FSOUND_INIT() and FSOUND_CLOSE() only at the beginning and at the end of the application?

  • You must to post comments
0
0

Thank you Brett. I remove FSOUND_Close from MyStreamCallback as you said and just call it one time at the end of my application and now FMOD work’s very well. 😀

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.