This has probably been done before with FMod but I can’t seem to find any examples of it.
I’m using FMod in a new version of a 3D game development program and would like to to use it to play the audio portion of an AVI file. In the previous version of this program we used a DirectSound buffer and filled it directly from the audio stream.
I have tried creating an FMod stream and using the callback to fill the buffer and to extract the entire audio stream into memory and play it as a sound without success. I’m obviously missing something when I do this since I get random sound being played.
Can anyone point me toward an example of how to play AVI sound with FMod? Any help would be appreciated.
- Dairyman asked 14 years ago
You can stream the sound in PCM by using DSP callbacks.
Look for the winamp in_*.dll plugin example to stream the plugin data to FMOD.
Maybe that helps.
Using the Stream_File/Play functions work very well for AVI files with PCM sound. The video frames are fetched by time so the sound stays in sync no problem. There is a problem for files that use MP3 sound though. The sound is random garbage and it causes a major stuttering of the video playback. I assume this is because FMOD expects the audio stream to be PCM only and it doesn’t decompress the data. This isn’t a huge problem (the old version we used only supported PCM sound) but it would be nice to support MP3 sound.
I only have one AVI with MP3 sound (a DivX file) and it makes sounds like someone gargling underwater. It plays fine in the DivX player. I tried playing it without any video being used and the same sounds appeared. What flags are you using in the FSOUND_Stream_OpenFile function? I use FSOUND_NORMAL and that seems to work in every other situation. All other AVI files I have are either PCM or ADPCM sound and everything works correctly.
BTW, this is the first time I’ve used FMod in an application and I’m very impressed by the ease in which I set it up and had it interfaced to my Audio Manager. Very professional work.
Please login first to submit.