-1

Trying to use the BackgroundAudioAgent just like a previous post: How do I stream an MP3 over HTTP in the background?

The answer says to just put the radioreference.relay.com URL in an AudioTrack object.

Here's my code:

        // A playlist made up of AudioTrack items.
    private static List<AudioTrack> _playList = new List<AudioTrack>
    {
        new AudioTrack(new Uri("Ring01.wma", UriKind.Relative), 
                        "Ringtone 1", 
                        "Windows Phone", 
                        "Windows Phone Ringtones", 
                        //new Uri("shared/media/Ring01.jpg", UriKind.Relative)),
                        null),

        // A remote URI
        new AudioTrack(new Uri("http://relay.radioreference.com:80/346246215", UriKind.RelativeOrAbsolute),
                            "Title",
                            "Artist",
                            "Album",
                            null),


        // A remote URI
        new AudioTrack(new Uri("http://traffic.libsyn.com/wpradio/WPRadio_29.mp3", UriKind.Absolute), 
                        "Episode 29", 
                        "Windows Phone Radio", 
                        "Windows Phone Radio Podcast",
                        //new Uri("shared/media/Episode29.jpg", UriKind.Relative))
                        null)
    };

From there it's just the sample code from Microsoft (http://go.microsoft.com/fwlink/?LinkId=226292).

The first and third track from the sample play, but the radioreference.com track doesn't work. I've tried removing the :80, changing the UriKind to Absolute, removing the http, etc. It winds up calling the OnError handler in the sample code and just bails out.

Any other ideas on this?

Community
  • 1
  • 1
John Clement
  • 81
  • 1
  • 6
  • [Please check this Question and my answer, it may help you.][1] [1]: http://stackoverflow.com/questions/9490356/how-do-i-stream-an-mp3-over-http-in-the-background/9493506#9493506 – Santhu Mar 07 '12 at 06:25
  • That's what I was refering to, but it doesn't work for me. Do you have code that actually works with the URL listed in my code? I know it's valid because I can play it with a MediaElement no problem. – John Clement Mar 07 '12 at 06:30
  • Are you able play same url file with any other streaming player like , WMP or media element ?? – Santhu Mar 07 '12 at 07:23
  • Yes. I was able to play directly with MediaElement. See my answer below. I just had to add .mp3 to the end. *shrug* – John Clement Mar 08 '12 at 03:57

1 Answers1

0

Well, apparently for relay.radioreference.com I actually just had to add the .mp3 extension, even though it's not required by MediaElement.

            new AudioTrack(new Uri("http://relay.radioreference.com/346246215.mp3", UriKind.RelativeOrAbsolute),
                            "Title 3",
                            "Artist",
                            "Album",
                            null),

Duh. Hopefully this helps someone else who's using relay.radioreference.com.

John Clement
  • 81
  • 1
  • 6