If I need to release the sound, do I have to call FMOD_Channel_RemoveDSP() before FMOD_Sound_Release() too?
Does FMOD_Sound_Release() cancel when FMOD_System_CreateSound() is called and a sound file is still being loaded?
As you can see, I’m reassigning the old values again. I want to match all the settings over all the music.
How can I reuse the same old channel so that I don’t have to set those again?
Or what if I want to replay the same music with the same settings when finished?
Is there something wrong, forgot to do, or any advice as for the code above?
This is not my production code, of course, but I wanted to make sure if I’m missing or misunderstanding something before starting the project.
If I need to release the sound, do I have to call
FMOD_Channel_RemoveDSP() before FMOD_Sound_Release() too?
No, you can if you want, but addDSP will remove it from wherever it was previously so you should be ok.
Does FMOD_Sound_Release() cancel when FMOD_System_CreateSound() is called
and a sound file is still being loaded?
No they are not running side by side, they operate in order that you call it. If you call release first, then createSound will happen second.
As you can see, I’m reassigning the old values again. I want to match all the settings
over all the music. How can I reuse the same old channel so that I
don’t have to set those again? Or what if I want to replay the same
music with the same settings when finished?
playSound resets all Channel values, so you will have to re-set everything.
The DSP has its own properties, so the parameters for that are not affected.
Is there something wrong, forgot to do, or any advice as for the code above?
FMOD_System_PlaySound is not pausing the sound with startpaused=true
This means the addDSP and setVolume will happen slightly after you start playing the sound, which might cause a small burst of noise that you dont want.
It is better to set startpaused=true and then after changing attributes, call FMOD_Channel_SetPaused(channel, false);
A big file would still only take a second or so to load, but no, you can’t cancel it.
You can override fmod’s file system, and make the read callback give data back to fmod in small chunks. If you wanted to cancel in the middle of a load your file callback could return FMOD_ERR_FILE_BAD or something and the createSound would bail out half way.