0
0

Hi,

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?

Andy

  • You must to post comments
0
0

I should add that I know all about the system callback for DEVICELISTCHANGED, I assume I have to release and re-init the System object, I just can’t see a way of making the EventSystem use the new driver.

  • You must to post comments
0
0

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.

WM_DEVICECHANGE

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.

HiTech

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.