Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > irrKlang
Problem with changing output device
Author Text

Registered User
2020-10-12 15:37:23

When I remove headsets from an audio jack or add headsets to an audio jack the sound stops playing. This happens because engine does not change output device automatically. And I can't understand how can I solve this problem properly. And it looks like Irrklang makes it even much more difficult.

First of all, I want to change output device exactly when I remove or add headsets. I wanted to use IMMNotificationClient and IMMDeviceEnumerator for this purpose, but although they allow me to find out the exact moment when to change the output device they cause error when exit program (when used together with irrklang). I think this error happens because irrklang already uses CoInitialize() and CoUninitialize(). However, this is not the main issue.

Secondly, as I see, I can't just change an actual device for sound engine when add or remove headsets. As I understood, I have to create a new irrklang device every time I need to change the output device. It would not be a big problem, if I didn't use ISound pointers in different classes to manage sound instances from those classes.

Is there any good solutions of my problems?

P.S. Please do not write me anything about ISoundDeviceList. It is absolutely useless for this kind of situations. It is useful only when a user does not want to use the default output device for some reason. Otherwise this class does not help to understand when headsets were removed or added, or does not allows to change the using device.

2020-10-13 08:02:28

Yes, this doesn't work using DirectSound nicely, unfortunately. If you want this to work, you could set the audio driver to WinMM instead, I think it should work there automatically like you want it to work.

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "Intern?tional" (you are not logged in)




Forum Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]