Language

AppNotificationBuilder.SetAudioEvent メソッド

定義

オーバーロード

名前 説明
SetAudioEvent(AppNotificationSoundEvent)

アプリ通知のオーディオ イベントを設定します。

SetAudioEvent(AppNotificationSoundEvent, AppNotificationAudioLooping)

アプリ通知のオーディオ イベントとループ動作を設定します。

SetAudioEvent(AppNotificationSoundEvent)

アプリ通知のオーディオ イベントを設定します。

public:
 virtual AppNotificationBuilder ^ SetAudioEvent(AppNotificationSoundEvent appNotificationSoundEvent) = SetAudioEvent;
/// [Windows.Foundation.Metadata.Overload("SetAudioEvent")]
AppNotificationBuilder SetAudioEvent(AppNotificationSoundEvent const& appNotificationSoundEvent);
[Windows.Foundation.Metadata.Overload("SetAudioEvent")]
public AppNotificationBuilder SetAudioEvent(AppNotificationSoundEvent appNotificationSoundEvent);
function setAudioEvent(appNotificationSoundEvent)
Public Function SetAudioEvent (appNotificationSoundEvent As AppNotificationSoundEvent) As AppNotificationBuilder

パラメーター

appNotificationSoundEvent
AppNotificationSoundEvent

再生するシステム サウンドを指定する AppNotificationSoundEvent 列挙体のメンバー。

返品

追加のメソッド呼び出しをチェーンできるように、AppNotificationBuilder インスタンスを返します。

属性

例

次の例では、アプリ通知の XML ペイロードでオーディオ イベントを設定する方法を示します。

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .SetAudioEvent(AppNotificationSoundEvent.Alarm)
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

結果の XML ペイロード:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <audio src='ms-winsoundevent:Notification.Looping.Alarm'/>
</toast>

注釈

このメソッドを使用すると、標準化されたシステム サウンドを使用するオーディオ イベントの種類を指定することで、一貫したオーディオ エクスペリエンスを提供できます。 SetAudioUri) を呼び出すことで、アプリ通知のカスタム サウンドを指定できます。

AppNotificationBuilder API を使用してアプリ通知用の UI を作成する方法については、「アプリ通知コンテンツ参照してください。

アプリ通知の XML スキーマのリファレンス情報については、「アプリ通知コンテンツ スキーマ」を参照してください。

適用対象

SetAudioEvent(AppNotificationSoundEvent, AppNotificationAudioLooping)

アプリ通知のオーディオ イベントとループ動作を設定します。

public:
 virtual AppNotificationBuilder ^ SetAudioEvent(AppNotificationSoundEvent appNotificationSoundEvent, AppNotificationAudioLooping loop) = SetAudioEvent;
/// [Windows.Foundation.Metadata.Overload("SetAudioEvent2")]
AppNotificationBuilder SetAudioEvent(AppNotificationSoundEvent const& appNotificationSoundEvent, AppNotificationAudioLooping const& loop);
[Windows.Foundation.Metadata.Overload("SetAudioEvent2")]
public AppNotificationBuilder SetAudioEvent(AppNotificationSoundEvent appNotificationSoundEvent, AppNotificationAudioLooping loop);
function setAudioEvent(appNotificationSoundEvent, loop)
Public Function SetAudioEvent (appNotificationSoundEvent As AppNotificationSoundEvent, loop As AppNotificationAudioLooping) As AppNotificationBuilder

パラメーター

appNotificationSoundEvent
AppNotificationSoundEvent

再生するシステム サウンドを指定する AppNotificationSoundEvent 列挙体のメンバー。

loop
AppNotificationAudioLooping

オーディオのループ動作を指定する AppNotificationAudioLooping 列挙体のメンバー。

返品

追加のメソッド呼び出しをチェーンできるように、AppNotificationBuilder インスタンスを返します。

属性

例

次の例では、アプリ通知の XML ペイロードでオーディオ イベントを設定する方法を示します。

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .SetAudioEvent(AppNotificationSoundEvent.Alarm, AppNotificationAudioLooping.Loop)
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

結果の XML ペイロード:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <audio src='ms-winsoundevent:Notification.Looping.Alarm' loop='true'/>
</toast>

注釈

このメソッドを使用すると、標準化されたシステム サウンドを使用するオーディオ イベントの種類を指定することで、一貫したオーディオ エクスペリエンスを提供できます。 SetAudioUri) を呼び出すことで、アプリ通知のカスタム サウンドを指定できます。

AppNotificationBuilder API を使用してアプリ通知用の UI を作成する方法については、「アプリ通知コンテンツ参照してください。

アプリ通知の XML スキーマのリファレンス情報については、「アプリ通知コンテンツ スキーマ」を参照してください。

適用対象