Audio streaming in windows phone 8

3.7k views Asked by At

I'm new to windows phone 8.

In my application I am getting the audio file path from the server. Now when the user clicks on listen button in my app, then I have to play that audio file.

For example: http://traffic.libsyn.com/wpradio/WPRadio_29.mp3

What are the different ways to play the above audio file.

Thanks

2

There are 2 answers

2
Romasz On

If I were you I wouldn't do that with MediaElemnt - it will work, but not in Background - question here.

Much better option is to play it with Background Audio and AudioStreamingAgent. Here you have one blog where you can find usefull information. There are also many examples.

0
Heena Mulla On

Yes you can play it with MediaElement. You must have audio uri path.

MediaElement remotePlayer= new MediaElement();
remotePlayer.AutoPlay=true;
//FileName is your remote uri
 remotePlayer.Source = new Uri(FileName, UriKind.Absolute);
                    remotePlayer.Play();