Search code examples
c#windows-runtimewindows-phone-8.1streamingshoutcast

Play Stream from ShoutCast Server on Windows Phone RunTime 8.1


Please, Is there someone there that can help me? I am trying to play a stream from a ShoutCast server on Windows Phone RunTime 8.1 and I had no success so far.

My company has 3 stream servers; 1 IceCast and 2 ShoutCast.

This is my code for IceCast server:

Uri audioSourceUrl = new Uri(url,UriKind.RelativeOrAbsolute);
BackgroundMediaPlayer.Current.SetUriSource(audioSourceUrl);
               BackgroundMediaPlayer.Current.Play();

I set the url to the background appication the app has and it is done. But with shoutcast I cannot do that.

I've tried to change the url with no success to :

1- "http://IP:PORT/;stream.mp3";

2-http://IP:PORT/;&type=mp3

3-http://IP:PORT/;

I read I have to manipulate the stream to get it working but I have no idea.

Can someone show me a light?

Thank you in advance!


Solution

  • Shoutcast format isn’t supported on the platform. You can support the protocol yourself by developing a custom media stream source (in Silverlight) or custom media source (Windows RT). However both tasks are hard.

    There’re several third-party Silverlight libraries implementing media stream source.

    • Shoutcast MSS — freeware and opensource, abandoned, can be fixed, but will take a lot of time. I tried that but failed, developed my own one that works OK (see below)
    • Apollo SDK — commercial, €200 per app, support both Silverlight (8.0+) and WinRT 8.1.
    • Jupiter SDK — commercial, €100 per app, only support WinRT 8.1, you probably need this one.
    • My own one — freeware and opensource, only supports Silverlight, works on WP 7.5+.
    • New Microsoft's FFmpegInterop - only support WinRT 8.1+, free.