Forum Xamarin.Forms

Playing a sound across all platforms

MaciejGawelMaciejGawel PLMember
edited February 2016 in Xamarin.Forms

I'm literally done with trying to play a sample sound (mp3 or ogg) across all platforms. For Android and iOS it was really easy, but for WinPhone 8.1 Silverlight I can't get it to go. For 2 or 3 days I've trying different things and nothing works. I know there is this class SoundEffect but it enables only wave, which is unacceptable for me beacuse of the file size. I've only managed to play sound using MediaElement but it was a pure non Xamarin 8.1 Silverlight project. In order to make it work I needed to add MediaElement in XAML. But I'm using dependecy service and I don't know how to add this MediaElement control only for WP (directly in MainPage.xaml in WP project?) nor how can I access this control from my interface implementation class.

Hope someone can help me,


Sign In or Register to comment.