Home Reaading Audio in a UWP application
Reply: 0

Reaading Audio in a UWP application

Damien Doumer
1#
Damien Doumer Published in 2017-12-05 18:31:03Z

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));
Debug.WriteLine(file.Path);
var f = File.Exists(file.Path);

player.AutoPlay = false;
player.Source = MediaSource.CreateFromStorageFile(file);
player.Play();

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.245501 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO