Hi,all there,I am a new user to FMOD(3.74).My development environment is EVC3.0+PPC2002 Emulator+TOSHIBA e740(PPC2002).Include following code in my application:
FSOUND_SAMPLE * snd_stylar;
FSOUND_SAMPLE * buy_succ;
FSOUND_SAMPLE * buy_fail;
FMUSIC_MODULE * back_Music;
FMUSIC_MODULE * music_start;
FMUSIC_MODULE * music_end;
snd_stylar =FSOUND_Sample_Load(77,"SNDFX001.WAV",FSOUND_LOOP_OFF,0,0); buy_succ =FSOUND_Sample_Load(76,"SNDFX003.WAV",FSOUND_LOOP_OFF,0,0); buy_fail =FSOUND_Sample_Load(75,"SNDFX004.WAV",FSOUND_LOOP_OFF,0,0); music_start=FMUSIC_LoadSong("BGM001.xm"); back_Music=FMUSIC_LoadSong("BGM002.xm"); back_Music=FMUSIC_LoadSong("BGM003.xm"); back_Music=FMUSIC_LoadSong("BGM004.xm"); back_Music=FMUSIC_LoadSong("BGM005.xm"); music_end=FMUSIC_LoadSong("BGM006.xm"); FMUSIC_SetMasterVolume(back_Music,256); //???? snd_inited=true;
(all the “XM” files with 32 chanels 48 samples,and each sample with 8bit;all the sound files are 22k/8bit/Mono)
After the Initialization,I random play the music with[b:1yo6gmdq]”if(bMusic)FMUSIC_PlaySong(back_Music[music_idx]);”[/b:1yo6gmdq],and play the sound effect with[b:1yo6gmdq]”if(bSound)FSOUND_PlaySound(76,buy_succ);”[/b:1yo6gmdq]according to some event,run the application a certain time,I stop all the playing with [b:1yo6gmdq]”FMUSIC_StopAllSongs();” [/b:1yo6gmdq],then,I restart the playing.
In the begin,music and sound all runs fine in the same time,either in Emulator or in my TOSHIBA e740.But after “stop” and “restart” playing several times,no problem in music playing;and the sound effect go bad,at this time,stop the music playing,play the sound effect only,it recover at once.I can not find the what cause it! [b:1yo6gmdq]help me!Thanks![/b:1yo6gmdq]
- Anonymous asked 13 years ago
😳 Oh,sorry!My application is a small game,when the game running,I random play one of the four musics(back_Music) as background music.When the music is playing,also play the sound(snd_stylar,
buy_succ,buy_fail;they are short,samll size .wav file)when the game needed.In the begin,the music and the sound are all playing fine.after a certain time,when the music be played several times,the music is still fine;the sound “goes bad”,that is:[i:1t65vohq]the sound changed,it becomes very hoarse and short![/i:1t65vohq]In this time,if I stop the music with “FMUSIC_StopAllSongs();”,the sound can be recovered!as if the music affects the sound!
Please login first to submit.