I’m new to FMOD and I’m trying to add some sound effects to a game in Ogre. I’m programming in C++. I created some 2D sound effects to make sure I could get things running, and now I’d like to make some 3D ones for realism.
My problem is that whenever I call System::createSound() with the mode FMOD_3D, it returns FMOD_ERR_FORMAT (Unsupported file or audio format.) Here are my calls:
[code:lezhsen4]ERRCHECK( gSystem->createSound(".\sounds\laser_burst.wav", FMOD_3D, NULL, &gSoundLaser) );
ERRCHECK( gSystem->createSound(".\sounds\Thruster_Level_II.aiff", FMOD_3D, NULL, &gSoundThrusters) );[/code:lezhsen4]
Like I said, both sounds load and play if I use FMOD_2D, but not FMOD_3D. I even tried copying the code from the 3D example and it still won’t load! Can anyone lend a hand please?
edit: I discovered that when I try to load the sound file "drumloop.wav" that comes with the FMOD examples it loads. Can only certain audio files be played as 3D sounds? And if so, how can you tell (since I’m also trying to load a .wav file and it isn’t working)?
- Moohasha asked 10 years ago
Thanks, that did the trick. I did go through the manual and documentation, but I’m no audio guru and I don’t understand a lot of this stuff, so I didn’t see my problem in there. I had no idea my sound files were stereo.
What would be the best way to test for this in code without knowing ahead of time that this is the case? Should I try just doing FMOD_3D first, and if it returns FMOD_ERR_FORMAT then try FMOD_SOFTWARE | FMOD_3D?
- Moohasha answered 10 years ago
Please login first to submit.