Xamarin-Plugins icon indicating copy to clipboard operation
Xamarin-Plugins copied to clipboard

[WPF] Short snippets of sounds play on application start

Open kristijan-boskovic opened this issue 4 years ago • 3 comments

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.

kristijan-boskovic avatar Mar 31 '20 12:03 kristijan-boskovic

Have you found any answers on this? I'm having the same problem. :(

mycoalchen avatar Jan 03 '21 23:01 mycoalchen

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.

kristijan-boskovic avatar Jan 04 '21 08:01 kristijan-boskovic

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.

mycoalchen avatar Jan 04 '21 13:01 mycoalchen