Hi!
I’ve just started working with fmodex its really cool.
But now I stumpled right into an annoying problem.
I’m trying to determine wether my sound is playing or not. (im making sort of a hardcoded playlist.)
I’ve heard that the "way" to do this is using callbacks, could someone explain that a bit further to me?
the init part:
init() {
FMOD_System_Create(&system);
FMOD_System_Init(system,1,FMOD_INIT_NORMAL,NULL);
}
playsong() {
FMOD_System_CreateSound(system,"test.wav",FMOD_SOFTWARE | FMOD_2D |FMOD_CREATESTREAM,0,&sound);
FMOD_System_PlaySound(system,FMOD_CHANNEL_FREE,sound,0,channel);
}
isplaying() {
FMOD_BOOL isplaying;
FMOD_System_Update(system);
FMOD_Channel_IsPlaying(channel,&isplaying);
if(!isplaying) {
printf("sound is not playing :D";
}
}
//
question is. is there a much better way to do this ? couse shit ain’t workin -.-
tnx!
//lusius
- Lusius Esox asked 9 years ago
- You must login to post comments
All those FMOD functions return a FMOD_RESULT, FMOD_Channel_IsPlaying could be returning FMOD_ERR_INVALID_HANDLE which also means it is not playing. It’s important to check the FMOD_RESULT returned from all the FMOD functions.
It probably easier to do what you want to do using the FMOD_Sound_SetSubSound and FMOD_Sound_SetSubsoundSentence.
Have a look at the realtimestiching example to see how to use these features.
-Pete
- Guest answered 9 years ago
- You must login to post comments
Please login first to submit.