locked
Media Foundation Audio destinations RRS feed

  • Question

  • I would like to use Media Foundation for the final version of a rather sophisticated record/playback application.  The user's machine may have multiple output sources, and obviously we want to allow them to choose which one to use.  I've been looking over the documentation for topology and am not seeing very much about choosing an audio output sink.  There will be times when we're doing both video and audio, but the question arises with regards to audio.

    Originally I was using WASAPI for playback, but ran into problems with shared mode.  Media Foundation looks like a better bet in a number of ways, but we really need to be able to show our users information about each output device and allow them to choose which one to use.


    Tuesday, October 30, 2012 4:31 AM

Answers

  • By default the Streaming Audio Renderer will play to the default console endpoint.  But you can specify a different role (communications) or specify a WASAPI endpoint ID instead.  To do so, set one of the following MF attributes on the attribute store you pass to the creating function for the Streaming Audio Renderer:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa378405(v=vs.85).aspx

    MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ID: Specifies the identifier for the audio endpoint device (as returned from IMMDevice::GetId)
    MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ROLE: Specifies the audio endpoint role for the audio renderer (eConsole or eCommunications)


    Matthew van Eerde


    Tuesday, October 30, 2012 5:33 AM

All replies

  • By default the Streaming Audio Renderer will play to the default console endpoint.  But you can specify a different role (communications) or specify a WASAPI endpoint ID instead.  To do so, set one of the following MF attributes on the attribute store you pass to the creating function for the Streaming Audio Renderer:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa378405(v=vs.85).aspx

    MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ID: Specifies the identifier for the audio endpoint device (as returned from IMMDevice::GetId)
    MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ROLE: Specifies the audio endpoint role for the audio renderer (eConsole or eCommunications)


    Matthew van Eerde


    Tuesday, October 30, 2012 5:33 AM
  • Thanks, that's exactly what I needed.
    Tuesday, October 30, 2012 3:16 PM