audio (トースト XML スキーマ)

トースト通知を表示するときに再生するサウンドを指定します。 この要素を使用すると、トースト通知オーディオをミュートできます。

要素の階層

<トースト>
<オーディオ>

構文

<audio src?    = string
       loop?   = boolean
       silent? = boolean />

キー

? 省略可能 (0 または 1)

属性および要素

属性

属性 説明 データ型 必須 既定値
loop

トーストが 表示されている限 りサウンドが繰り返される場合は true に設定します。 1 回だけ再生する場合は false。 この属性が true に設定されている場合は、toast要素の duration 属性も設定する必要があります。 ループ時に使用する特定のサウンドが用意されています。 UWP アプリでは、ループ オーディオも長時間のトーストもサポートされていません。

boolean いいえ false
サイレント

サウンドを ミュートする場合は True。 トースト 通知サウンドの再生を許可する場合は false。

boolean いいえ false
src

既定のサウンドの代わりに再生するメディア ファイルです。 このWindows属性には、次のいずれかの文字列値を指定できます。

  • 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.Alarm3
  • ms-winsoundevent:Notification.Looping.Alarm4
  • ms-winsoundevent:Notification.Looping.Alarm5
  • ms-winsoundevent:Notification.Looping.Alarm6
  • ms-winsoundevent:Notification.Looping.Alarm7
  • ms-winsoundevent:Notification.Looping.Alarm8
  • ms-winsoundevent:Notification.Looping.Alarm9
  • ms-winsoundevent:Notification.Looping.Alarm10
  • ms-winsoundevent:Notification.Looping.Call
  • ms-winsoundevent:Notification.Looping.Call2
  • ms-winsoundevent:Notification.Looping.Call3
  • ms-winsoundevent:Notification.Looping.Call4
  • ms-winsoundevent:Notification.Looping.Call5
  • ms-winsoundevent:Notification.Looping.Call6
  • ms-winsoundevent:Notification.Looping.Call7
  • ms-winsoundevent:Notification.Looping.Call8
  • ms-winsoundevent:Notification.Looping.Call9
  • ms-winsoundevent:Notification.Looping.Call10

カスタム サウンドの詳細については、「解説」セクションを参照してください。

string いいえ なし

 

子要素

なし。

親要素

Parent 要素 説明
トースト

少なくとも 1 つのビジュアル要素を含む基本 トースト要素

 

注釈

デスクトップ プラットフォームを対象とする UWP アプリでは、Windows 10 バージョン 1511 (ビルド 10586) 以降でカスタム トースト通知がサポートされています。 以前のバージョンでは、上の表 ms-winsoundevent の src 属性に一覧表示されている値 一覧から選択できます。 カスタム トースト通知サウンドの詳細については、「トーストの カスタム オーディオ」を参照してください

アプリペイロードでカスタム ファイル パスを指定すると、指定したシナリオに基づいて既定のサウンド (通知、呼び出し、アラーム、またはアラーム) が再生されます。

次のコードは、このタグの例を示しています。

<audio src="ms-winsoundevent:Notification.Mail" loop="false"/>
                

次のコードは、トースト通知オーディオをミュートするために使用されるこのタグを示しています。

<audio silent="true"/>
                

関連項目