다음을 통해 공유


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 instance 반환합니다.

특성

예제

다음 예제에서는 앱 알림에 대한 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 instance 반환합니다.

특성

예제

다음 예제에서는 앱 알림에 대한 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 스키마에 대한 참조 정보는 앱 알림 콘텐츠 스키마를 참조하세요.

적용 대상