Answered
0
0

I’ve currently got an issue where if the game is started with no headphones plugged in, and then the user plugs in some headphones, they have no sound.

I’m thinking this is because some sound drivers report 0 speakers, and then detect the jack setting and go to 2.

How have other people dealt with this issue?

  • You must to post comments
Best Answer
0
0

You might want to look into FMOD_SYSTEM_CALLBACKTYPE_DEVICELISTCHANGED

  • You must to post comments
0
0

Hello.
We have same problem, and solution mentioned above is not working.
Version is Fmod Ex 4.4x

Here’s how it is:
1. Remove headphones (or other devices from sound card).
2. Set callback: System->setCallback(Callback)
3. Set some other settings, like System->setSpeakerMode() //Tried FMOD_SPEAKERMODE_STEREO & FMOD_SPEAKERMODE_RAW here
4. EventSystem->init() returns FMOD_ERR_OUTPUT_INIT and state becomes FMOD_ERR_UNINITIALIZED.

After that, no callback is ever called. So I cannot handle FMOD_SYSTEM_CALLBACKTYPE_DEVICELISTCHANGED and re-init something.

P.S. My code works for case when headphones present, and then swapped: FMOD_SYSTEM_CALLBACKTYPE_DEVICELISTCHANGED event is fired properly.

  • Nicholas Wilcox

    If getNumDrivers() returns 0 then you need to switch to the FMOD_OUTPUTTYPE_NOSOUND. The system can then be successfully initialized and will generate FMOD_SYSTEM_CALLBACKTYPE_DEVICELISTCHANGED callbacks.

  • Dmitry Vladimirov

    Thank you! It works, but another problem emerged.

    When I then insert headphones and receive callback event, I get 1 from getNumDrivers, but setDriver(0) seems to have no audible effect. I think it’s because my output type is still FMOD_OUTPUTTYPE_NOSOUND.

    But System->setOutput(FMOD_OUTPUTTYPE_DSOUND) fails with FMOD_ERR_INITIALIZED.

    How can I re-enable sound properly?

  • Nicholas Wilcox

    The only option is to shutdown the system and re-initialize with a different output mode. This limitation was addressed in Studio which allows output switching without re-initialization.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.