I’m looking for some advice on the safest way to restart the FMOD EventSystem when the user’s hardware changes.
In Windows 7, at least on our Dell PCs here, if a player starts the game without headphones (or speakers) attached, FMOD starts up in ‘NO_SOUND’ mode. The game can then carry on as normal as if sounds are actually playing. But, when headphones/speakers are connected, I’d like to re-initialise the system. As far as I can see, there’s no function for this. I can periodically try re-initting the system if in NO_SOUND mode, but I really don’t want to shut down and re-initialise all the game systems when a sound device is found.
Is there any quick and dirty way of achieving this?
- anparton asked 5 years ago
To choose the device you wish to play sound on, do a EventSystem:getSystemObject and then use the the call System::setDriver to select the output device.
I believe you will want to make sure no sounds are currently player when you do this. I am just in the proccess of implementing it, but have used the same method with other sound systems.
Also if you intercept the windows message.
You can detect when a user has plugged in his head phones or any other device.
If at start up time you make the gall System::getNumDrivers you can then detect if it was a sound device that has been pluged in do the the change in the Device count.
Please login first to submit.