This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
msAudioCategory property of the HTML <audio> element, is a read/write proprietary attribute, specific to Internet Explorer and Microsoft Edge.
msAudioCategory specifies the purpose of the audio or video media, such as background audio or alerts.
<audio controls="controls" msaudiocategory="BackgroundCapableMedia"> </audio>
msAudioCategory property offers a variety of values that can enhance the behavior of your audio-aware app.
Note that you must set the
msAudioCategory before setting the
src property in code.
Include a description of the property's value, including data type and what it represents.
|Alert||Looping or longer running alert sounds:
|BackgroundCapableMedia||For audio that needs to continue playing in the background. Examples include the following local media playback scenarios:
|Communications||For streaming communication audio such as the following:
|GameMedia||Background music played by a game||No|
|Other||Default audio type, and recommended for all audio media that does not need to continue playing in the background.||No|
msAudioDeviceType is not explicitly set,
msAudioDeviceType will be set to Communications.
For hardware audio offload to be automatically applied, the audio category must be set to ForegroundOnlyMedia or BackgroundCapableMedia. Hardware audio offload optimizes audio rendering which can improve functionality and battery life.
<audio msAudioCategory="BackgroundCapableMedia" controls="controls"> <source src="song.mp3"/> </audio>