Xamarin-Plugins
Xamarin-Plugins copied to clipboard
[WPF] Short snippets of sounds play on application start
I used your SimpleAudioPlayer for Xamarin.Forms application and it works perfectly. Recently I started working on the WPF application that has shared code with that Xamarin.Forms application. While each audio stream loads to a player on application start, a very short snippet (like 0.1 sec) of each .mp3 file is played. There may be an issue with resources, because I am getting these sounds from a resources project (which works perfectly with Xamarin.Forms). I tried using the WPF version of your NuGet package but the result was exact same. Thank you in advance!
EDIT: After investigating the problem I found out that the issue may be in MediaPlayer itself, since this SimpleAudioPlayer is based on MediaPlayer for WPF. I tried loading .mp3 files in bare MediaPlayer and I got the exact same outcome, short snippet playing on Open(uri) method.
Have you found any answers on this? I'm having the same problem. :(
Have you found any answers on this? I'm having the same problem. :(
Unfortunately not. In the end, I didn't need the sounds in my application, so I just ditched it.
Thanks for the reply. Actually I found that moving the MediaPlayer setup out of the MainWindow constructor and into a separate play function worked, in case this helps anyone.