1

I need some help on how to read taginfo (song/artist) from a online radiostream. I'm building my app in c# and I use the mediaelement.

When I play this steam in windows media player/winamp it show the current playing song.

I have tried the MarkerReached event, but nothing happens.

Here is the code I tried. I can't get it working.

            string responseBodyAsText;
            textblock.Text = "Click...";
            Uri apiurl = new Uri("http://streamurl");

            // create request
            HttpClient client2 = new HttpClient();
            client2.MaxResponseContentBufferSize = 2560;
            client2.DefaultRequestHeaders.Add("user-agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36");
            client2.DefaultRequestHeaders.Add("GET", "/"+apiurl.ToString()+ " HTTP/1.0");
            client2.DefaultRequestHeaders.Add("Icy-MetaData", "1");
            HttpResponseMessage response2 = await client2.GetAsync(apiurl);

            //response2.EnsureSuccessStatusCode();

            responseBodyAsText = await response2.Content.ReadAsStringAsync();
            textblock.Text = responseBodyAsText.ToString();
Flexo
  • 87,323
  • 22
  • 191
  • 272
  • Can you provide some code of what you have tried? – Polygnome Jun 21 '13 at 20:56
  • You need to split the metadata from the stream yourself before sending the audio portion of the stream on to the component doing the decoding. I've written up how to do this here: http://stackoverflow.com/a/4914538/362536 It's for another language, but the concept is identical. – Brad Jun 22 '13 at 14:52

0 Answers0