Mike Minaev
Mike Minaev

Reputation: 2062

Switch audio device using winapi

i find this http://www.daveamenta.com/2011-05/programmatically-or-command-line-change-the-default-sound-playback-device-in-windows-7/ , and it works for me, but i want to switch audio devices, i have 2 audio devices, if active 1st turn on 2nd, if active 2nd turn on 1st. But i don't know is it possible to check if audio device active in windows

Upvotes: 2

Views: 3691

Answers (1)

manuell
manuell

Reputation: 7620

The IMMDeviceEnumerator COM Interface used by the program you linked has a GetDefaultAudioEndpoint method.

It returns an IMMDevice interface pointer, the same type of interface pointer that the linked program gets while enumerating.

Upvotes: 1

Related Questions