audio

9 out of 10 rated this helpful - Rate this topic

Specifies a sound to play when a toast notification is displayed. This element also allows you to mute any toast notification audio.

Element hierarchy

<toast>
<audio>

Syntax

<audio src?    = "ms-winsoundevent:Notification.Default" | "ms-winsoundevent:Notification.IM" | ...
       loop?   = boolean
       silent? = boolean />

Key

?   optional (zero or one)

Attributes and Elements

Attributes

AttributeDescriptionData typeRequiredDefault value
loop

True if the sound should repeat until addressed; false to play only once. If this attribute is set to "true", the duration attribute in the toast element must also be set.

booleanNofalse
silent

True to mute the sound; false to allow the toast notification sound to play.

booleanNofalse
src

The media file to play in place of the default sound.

This attribute can have one of the following string values:

  • ms-winsoundevent:Notification.Default
  • ms-winsoundevent:Notification.IM
  • ms-winsoundevent:Notification.Mail
  • ms-winsoundevent:Notification.Reminder
  • ms-winsoundevent:Notification.SMS
  • ms-winsoundevent:Notification.Looping.Alarm
  • ms-winsoundevent:Notification.Looping.Alarm2
  • ms-winsoundevent:Notification.Looping.Call
  • ms-winsoundevent:Notification.Looping.Call2
NoNone

 

Child Elements

None.

Parent Elements

Parent ElementDescription
toast

Base toast element, which contains a single visual element.

 

Remarks

If you do not supply audio information through this tag, or supply an invalid source value, the default sound will play.

Select a sound that matches your scenario. If none of the Windows-provided sounds seem suited to your scenario, use the default sound.

Examples

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.



<audio silent="true"/>

Requirements

Namespace

http://schemas.microsoft.com/notifications/2012/toast.xsd

 

 

Build date: 10/26/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.