共用方式為


Sample: find out if your default audio playback and audio capture devices are on the same hardware

This blog post has moved to https://matthewvaneerde.wordpress.com/2008/06/13/sample-find-out-if-your-default-audio-playback-and-audio-capture-devices-are-on-the-same-hardware/

Comments

  • Anonymous
    July 24, 2008
    This is a perfect example of how something should be much simpler than it is.  That's a ridiculous amount of code!

  • Anonymous
    July 25, 2008
    The comment has been removed

  • Anonymous
    November 05, 2008
    can you please tell me .......from where to get this DeviceTopology.h header file cz it seems not to be present.....

  • Anonymous
    November 06, 2008
    Download the Windows SDK. http://blogs.msdn.com/windowssdk/ On my machine devicetopology.h is in the following folder: C:Program FilesMicrosoft SDKsWindowsv6.0AInclude

  • Anonymous
    February 09, 2010
    > What are the scenarios when you need > to know what hardware is behind the audio endpoint? I'm just rambling here, but hey: Any app that provides voice communication, esp. games might be interested in knowing that. Users do care about their default output device, but a lot of errors in voice com stem from improperly set input configuration. If the user is already using e.g. a USB headset for output, the game can make a safe bet by using the headset's microphone. Or at least point the user to mismatching configs.

  • Anonymous
    October 27, 2015
    Hi Matthew, Can you please help us to find the parent id and hardware id of the audio device connected to the PC?

  • Anonymous
    October 27, 2015
    @Jyothy check out the Windows.Devices.Enumeration sample here. You can use the github.com/.../DeviceEnumeration There are four "selectors" under Windows.Media.Devices.MediaDevice which correspond to "the default audio render device", "the default audio capture device", "all audio render devices", and "all audio capture devices". msdn.microsoft.com/.../windows.media.devices.mediadevice.aspx You can traverse the device parent-child tree using the System.Devices.Parent property msdn.microsoft.com/.../mt187351.aspx But more interesting is the System.Devices.ContainerId property, which tells you what other devices are on the same hardware.