Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Xamarin.Forms.Labs SoundService doesn't work

$
0
0

Did the Sound sample form the Labs projekt work for somebody? First I tried to play a mp3 file which I didn't hear at all, except i put a break point on the line where I called soundService.PlayAsync method, then it worked. I tried that on various android simulators and also a physical device all with the same result. I can also reproduce the problem with the sample code form the Labs repository.

https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/Samples/XLabs.Sample/ViewModel/SoundServiceViewModel.cs

here is my code from my sample

public class PlaylistPage: ContentPage
{
    Button playing; 
    public PlaylistPage()
    {
        this.Title = "Playlist"; 
        playing = new Button {
            Text = "Play"
        }; 
        playing.Clicked += async (object sender, EventArgs e) => 
        {
            playing.Text = "Playing"; 
            SoundService _soundService = new SoundService(); 
            await _soundService.PlayAsync ("crash.mp3"); 
            playing.Text = "Played";
        }; 
        Content = playing; 

    }
}

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>