I want to do radio streaming in my application.For that i have tried following code.But this code is not working.Can anyone tell me what i am missing?
First i have added following reference in .xaml file

but it is not streaming.
If you copy above URL in browser then one page will be opened.In that page there is a "Listen" button. By clicking on that button one .pls file will be downloaded and by opening it the song will be played.
So can any one suggest me how to do streaming from above link?

Do you get any errors? Did you try pointing your control to the URL of the PLS file? Are you sure the service is streaming anything? When I visit the page I see "Server Status: Server is currently down"
–
madd0Nov 21 '11 at 15:26

Please clarify a coule of things... Is this in 7.1 or 7.0? In the emulator or on a device? Also you shouldn't need to use the SmoothStreamingMediaElement, the regular MediaElement should be fine. I've heard rumors that Shoutcast is supported in 7.1, it wasn't in 7.0 and you would have had to use a custom MediaSteamSource.
–
Bill ReissNov 21 '11 at 19:08

@ Bill Reiss it is 7.1 OS.Write now i am testing in Emulator.
–
StarkNov 22 '11 at 5:07

@ madd0 no i didn't get any error.And i also have tried pointing control to PLS file but it didn't work.
–
StarkNov 22 '11 at 5:08

2 Answers
2

Download the .pls file with a WebClient, then read the contents as a string. This should give you a URL that you can set as the Source property of the MediaElement control. If the format is supported by Silverlight, the audio will play.

You don't need to use SmoothStreamingMediaElement, just MediaElement if this is not a Smooth Stream (btw, I don't think there exist audio-only smooth streams, unless you use a 1x1 or other very small image for the video part)

Project Description Shoutcast MediaStreamSource is a MediaStreamSource
implementation of the Shoutcast protocol for Silverlight. This
MediaStreamSource allows both Silverlight 4+ OOB and Windows Phone 7
applications to consume a Shoutcast stream using a MediaElement.

Currently, Mp3 and AAC+ Shoutcast streams are supported on Windows
Phone. However, ONLY Mp3 is supported on Desktop Silverlight.

There is also limited (i.e. somewhat untested) M3u and PLS playlist
support.

Please report any issues playing Shoutcast streams with the following:
* URI to the problem stream
* Description of the problem
* The error returned (or not!) from the Shoutcast MediaStreamSource