audio (Toast XML Schema)
Specifies a sound to play when a toast notification is displayed. This element also allows you to mute any toast notification audio.
<audio src? = string loop? = boolean silent? = boolean />
? optional (zero or one)
Attributes and Elements
|Attribute||Description||Data type||Required||Default value|
Set to true if the sound should repeat as long as the toast is shown; false to play only once. If this attribute is set to true, the duration attribute in the toast element must also be set. There are specific sounds provided to be used when looping. Note that UWP apps support neither looping audio nor long-duration toasts.
True to mute the sound; false to allow the toast notification sound to play.
The media file to play in place of the default sound. On Windows, this attribute can have one of the following string values:
See the remarks section for information about custom sounds.
Base toast element, which contains at least a single visual element.
UWP apps that target the desktop platform support custom toast notification sounds on Windows 10, version 1511 (build 10586) and later. On earlier versions, you can choose from the list of
ms-winsoundevent values listed for the src attribute in the table above. For more information about custom toast notification sounds, see Custom audio on toasts.
If you specify a custom file path in the app payload, the default sound (notification, call, alarm, or reminder) will be played based on the specified scenario.
The following code shows an example of this tag.
<audio src="ms-winsoundevent:Notification.Mail" loop="false"/>
The following code shows this tag used to mute toast notification audio.