Hi everyone I'm trying to read an audio file in a UWP application using the method shown below:
MediaPlayer player = new MediaPlayer();
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/" + fileName));
var f = File.Exists(file.Path);
player.AutoPlay = false;
player.Source = MediaSource.CreateFromStorageFile(file);
But I get the following esception:
System.TypeInitializationException: 'The type initializer for 'Focus.Services.Utility' threw an exception.'
Please can someone help ? I tried several methods for reading audio files but none seems to give.