大家好我尝试使用下面显示的方法在UWP应用程序中读取音频文件:
MediaPlayer player = new MediaPlayer();
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/" + fileName));
Debug.WriteLine(file.Path);
var f = File.Exists(file.Path);
player.AutoPlay = false;
player.Source = MediaSource.CreateFromStorageFile(file);
player.Play();
但是我得到以下的猜测:System.TypeInitializationException: 'The type initializer for 'Focus.Services.Utility' threw an exception.'
请有人帮忙吗?我尝试了几种读取音频文件的方法,但似乎都没有。