Playing bundled music files

Hi,

FMOD doesn’t have any “easy” way of doing this i.e. no one function that will just scan your bundled files and figure out the length, format, etc. of each, but there are still ways to go about it - the easiest way would probably be to use FMOD_SOUND_CREATEEXINFO to specify a fileoffset and length for a given audio file in the bundle. Streaming should be as simple as adding FMOD_CREATESTREAM as a mode for the sound. Fundamentally though, you do need to know the location/length of all the sub-files in your bundled file.

However, FMOD comes with a soundbank format called FMOD Sound Bank (FSBank/FSB), which would allow you to encode and compress your BGM, and to load/stream specific subsounds from the FSBank. If this sounds like it’d be useful, I’d recommend taking a look at the fsbank_api example included with the FMOD Engine download, as well as the FSBank API Documentation.

1 Like