Home Reaading Audio in a UWP application
Reply: 0

Reaading Audio in a UWP application

user713 Published in April 20, 2018, 10:42 am

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.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298259 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO