How to select an audio output device (HTML)

[This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation]

This topic describes how to select an audio output device on the audio tag.

Instructions

Step 1: Send the audio output signals to the default audio output devices

Windows allows apps to send the audio output signals to various output devices using the msAudioDeviceType attribute (DOMString). With this extension, Windows Store apps can choose to send the audio output signals to the default audio output devices for multimedia, console, and communications, respectively. The attribute can only be set on the media tag explicitly and can’t be accessed through the Windows Runtime functions. The default value is “multimedia”.

Setting msAudioCategory to “communications” will force msAudioDeviceType to “true” and also set msRealtime to “communications” if the msAudioDeviceType attribute is not set explicitly.

   <audio src="GameEffect.avi" msRealtime=true 
       msAudioDeviceType="console" msAudioCatogery="soundeffects" />

Real-Time Communication Sample