Activate sound devices via code?


  • Hello!

    I posted this on 
    MSDN Forums » Audio and Video Development » Media Foundation Development
    before I found this forum. I think this is a better place. For some reasons I could not delete it there, so please don´t blame me for double-posting :)

    In the Vista sound-control-panel one can activate and deactivate what is now
    called sound devices (microphon, line-in, phone etc.)
    Is there a was to do this via code?

    First of all I did not manage it to get the deactivated devices by the
    EnumAudioEndpoints Method using the predefined flags.
    On my system the device state in the registry is 0x10000001, in case of a
    device not beeing active.
    I defined a custom flag with this value and the EnumAudioEndpoints
    method succesfully returned the deactivated devices.

    Is there a way to activate this devices? I tried to edit the registry
    entries via code, but got UnauthorizedAccess Exeptions. Using regedit
    The device object provides a GetState but unfortunately not a SetState

    Any hints would be very helpfull!

    Thank You and excuse my lack of english skills!
    Tuesday, December 12, 2006 9:39 PM

All replies

  • Sorry, there is no public API for changing the state of an audio endpoint device.  This is by design.


    Mitch Rundle


    This posting is provided "AS IS" with no warranties, and confers no rights.


    • Proposed as answer by micTronic Saturday, January 17, 2009 11:16 AM
    Tuesday, January 02, 2007 6:22 PM

    Wednesday, November 12, 2008 7:56 PM