0
나는 MediaElement 클래스를 사용하여 버튼 클릭시 간단한 사운드를 재생합니다. 그걸 두 번 두드리는게 아니라면 그건 잘된거야. 두 번째 탭에서 이전 사운드의 재생을 중지하고 사운드를 다시 시작하겠습니다. 하지만 Stop 메서드가 작동하지 않습니다.C# .NET에서 mediaElement로 WinRT (다시) 사운드 재생
public static MediaElement SoundDelete;
public static void PlaySoundCash()
{
if (SessionHelper.getConfig("SoundDelete") == "true")
{
System.Diagnostics.Debug.WriteLine(SoundDelete.Position.ToString());
SoundDelete.Stop(); //dosn't work
SoundDelete.Position = new System.TimeSpan(0,0,0,0,0); //dosn't work
System.Diagnostics.Debug.WriteLine(SoundDelete.Position.ToString());
SoundDelete.Play();
}
}
콘솔에서 시간 범위는 0이 아닙니다. 처음부터 사운드를 재생하려면 어떻게해야합니까?
. 어떤 예를 들려 줄 수 있습니까? –
요청에 따라 수정 된 게시물 – MickJ