앱 알림의 사용자 지정 오디오

앱 알림은 사용자 지정 오디오를 사용할 수 있으며, 이를 통해 앱은 브랜드의 고유한 음향 효과를 표현할 수 있습니다. 예를 들어 메시징 앱은 사용자가 일반 알림 소리를 듣는 대신 해당 앱에서 온 알림을 즉시 알 수 있도록 앱 알림에서 자체 메시징 소리를 사용할 수 있습니다.

앱 알림에 대한 자세한 내용은 앱 알림 개요를 참조하세요.

사용자 지정 오디오 추가

AppNotificationBuilder.SetAudioUri를 사용하여 알림에 대한 사용자 지정 오디오 파일을 지정합니다.

using Microsoft.Windows.AppNotifications;
using Microsoft.Windows.AppNotifications.Builder;

var notification = new AppNotificationBuilder()
    .AddText("New message")
    .SetAudioUri(new Uri("ms-appx:///Assets/Audio/CustomToastAudio.m4a"))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

지원되는 오디오 파일 형식:

  • .aac
  • .flac
  • .m4a
  • .mp3
  • .wav
  • .wma

지원되는 오디오 파일 원본:

  • ms-appx:///
  • ms-resource

지원되지 않는 파일 원본:

  • ms-appdata
  • http://, https://
  • C:/, F:/ 등

참고하십시오