How play a .mp3 (or other) file in a UWP app?

后端 未结 4 1118
眼角桃花
眼角桃花 2021-01-02 08:17

I try this:

PlayMusic = new MediaElement();
PlayMusic.AudioCategory = Windows.UI.Xaml.Media.AudioCategory.Media;

PlayMusic.Source = new Uri(@\"C:\\Users\\Us         


        
4条回答
  •  感情败类
    2021-01-02 08:34

    Register the MediaFailed-Event of the MediaElement and check if it gets raised. The ExceptionRoutedEventArgs passed to the method, should contain information about, why the file cannot be played.

提交回复
热议问题