In my games, I’m coming across cases where I would like to control several layers of sound through a single, multiplexed stream, i.e. the data is interleaved and elements are decoded at once without the problem of seeking between chunks of files located apart on the media.
Can we do this using FMOD?
At least volume control should be independant per layer.
On PSP, we can create ambiances that crossfade to one another without draining the battery while seeking all over the place.
- fredsifu asked 9 years ago
Yes you can do this, use FSBankEx.
You can input multiple files. Specify a directory and it will interleave them all into 1 file. The build mode is something like 1 fsb, multiple source files.
You can then use Channel::setInputChannelMix to control volumes of each subchannel.
You could also just encode 1 multichannel wave file using fsbank as well and that works too. SF9 for example allows multiple channel wave file editing.
I also have a need to create and load interleaved sound files. My question is, if I create one using FSBankEx and it gives me an fsb file, can I then just load this file (i.e. pass in the file name to System::playSound) or do I need to do something else?
More info: I can call System::createSound() passing in the name of the interleaved file and I get a valid sound, however when I try to call System::playSound I get an FMOD_ERR_SUBSOUNDS error. The docs say that I either cant perform this operation on a parent group, or, that I need to set up a sentence first. And from what the docs say about setting up sentences, those are used to determine sequencial playback order… which is not what I need, I need to be able to play them all back simultaneously.
Does anyone know what I need to do here?
[quote="PeterStirling":10bd75rm]It needs to be streaming, so use createStream or createSound with the FMOD_CREATESTREAM flag.[/quote:10bd75rm]Thnx for the reply. Actually, I already create the sound with the FMOD_CREATESTREM flag… it’s the only flag I’m passing in. Using createStream() gives the same results. =(
The FSB file format is actually a container format, so when you do a System::createSound() on the FSB file you have a "parent" sound that contains sub-sounds.
In your case you only have 1 sub-sound (your multichannel interleaved sound). So to access that sound you need to use Sound::getSubSound() and you would pass in 0 as the index for the first sub-sound.
Now you have the actual sound you can play it as normal and use Channel::setInputChannelMix as Brett suggested to control the individual subchannel volumes.
Please login first to submit.