I’ve just started working with FMOD, following the tutorial and referencing the playsound example distributed with the API. Before writing this, I spent quite a while searching through the forums to see if I’ve missed something, but to no avail.
As far as I can tell the following code should work:
using namespace std;
cout << "FMOD C++ Tutorial" << endl;
FMOD::System *system; FMOD::Sound *sound; FMOD::Channel *channel;
FMOD::System_Create(&system); result = system->init(32, FMOD_INIT_NORMAL, NULL); result = system->createSound("../swish.wav", FMOD_DEFAULT, NULL, &sound); result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel); sound->release(); system->release(); char foo; cin >> foo; return 0;
This code was written after I had followed the tutorial’s code, then also followed the code provided in the Windows platform specific issues section of the docs. In short, its the condensed aftermath of my attempts. The results have been consistently the same throughout.
All of the returns to [i:t4itzdlh]result[/i:t4itzdlh] are FMOD_OK.
I have changed the sounds from various .wav files to .mp3 I have on my system, eventually using the sounds out of the examples solution provided with the API.
I have enumerated through the driver list (I’m using an azalia onboard sound device for now) to ensure I’m using the proper one.
I have set the speakermode (both manually and from the windows platform specific issues code), its defaulted to stereo.
Despite all of this, the executable seems to run without an error; it simply doesn’t play the loaded sound. No speaker pops, no sign whatsoever that output is being generated. Even in the mixer controls there is no sign on the volume indicator that a sound is being played.
The rub: I can compile the playsound example, and it plays sound perfectly well.
I am running Vista x64 with realtek azalia onboard sound, building under VS2008 as win32 (with the win32 API)… and I have no idea what I’ve missed or implemented incorrectly.
Any help would be extraordinarily appreciated!
- Rudi_S asked 8 years ago
Hey Rudi, I must warn you I am fairly new to C++ but I will just take a shot at this … seems to me you are releasing the sound and system before it gets a chance to play my friend. You should make yourself a function to release the system and call it when you press a key or such. I hope that will put you in the right direction
Please login first to submit.