0
votes

TL;DR: When playing audio using Windows UWP MediaPlayer, how do I route audio to a specific audio device/endpoint?

Full Context

I'm working on an app to place calls. Some requirements are:

  • Play audio sounds at different points (e.g. when the call hangs up)
  • Allow users to change in-call audio output to different endpoints (not an issue)
  • Ensure that when in-call audio has routed to a different "default" endpoint, that any other sounds that are played are routed to the same endpoint (this is what I need help with)

Currently, when I route audio to a different endpoint, other sounds that are played with Windows UWP MediaPlayer do not get routed to the same "new" endpoint. This makes sense since we aren't changing application-wide settings.

My question is: How do I route audio to the same endpoint that the call audio is going through, given that I'm using Windows UWP MediaPlayer and given that I can get device information?

1
Does the following work, and do you have any updates? - Nico Zhu - MSFT

1 Answers

0
votes

When playing audio using Windows UWP MediaPlayer, how do I route audio to a specific audio device/endpoint?

Please check Output to a specific audio endpoint document. By default, the audio output from a MediaPlayer is routed to the default audio endpoint for the system, but you can specify a specific audio endpoint that the MediaPlayer should use for output. You could use GetAudioRenderSelector to get the render selector then use FindAllAsync to get render device the pass the specific device to mediaplayer AudioDevice property.