Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 786737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:05:26+00:00 2026-05-14T21:05:26+00:00

I have a SL4 project that is successfully streaming a great sounding WMA audio

  • 0

I have a SL4 project that is successfully streaming a great sounding WMA audio stream from a remote location. All of the MediaElement actions are straight forward.

What I want to do is read the attributes that are passed as text along with the Audio stream. For instance the encoder of the stream embeds the title of the stream, the title of the song playing and the name of the artist for the current song.

How would I pick this out using Silverlight 4 and then display it in a Label to the user?

It sure would be easier than writing a bunch of web services to do the same thing. Windows Media Player and WinAmp all get the information I am just not seeing it in the MediaElement object collection.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:05:26+00:00Added an answer on May 14, 2026 at 9:05 pm

    I found the answer after searchting the web as well as fiddling with Expression 3 a little as well.

    It turns out that a live audio stream has markers that are sent across as well as the audio. Markers can contain almost anything but one is called a “Caption”. The caption is basically a free-form string field that you can read. With my stream the encoder sends a lot of information across as a caption that can then be broken down. So here is the code I am using:

    Starts with registering a few events, the last one is the important one.

    public MainPage()
        {
            InitializeComponent();
            this.mediaElement1.BufferingProgressChanged += new RoutedEventHandler(mediaElement1_BufferingProgressChanged);
            this.mediaElement1.MarkerReached += new TimelineMarkerRoutedEventHandler(mediaElement1_MarkerReached);
        }
    

    Then the actual marker handler does the following:

    private void mediaElement1_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e)
        {
            Dictionary<string, string> songAttribs = new Dictionary<string, string>();
            string playerFeed = HttpUtility.UrlDecode(e.Marker.Text);
            char[] delims = { '&' };
            string[] Attribs = playerFeed.Split(delims);
    
            foreach (String attrib in Attribs)
            {
                string[] keypair = attrib.Split('=');
                string key = "";
                string value = "";
    
                try
                {
                    key = keypair[0];
                }
                catch
                {
                    key = null;
                }
    
                if (key != null)
                {
                    try
                    {
                        value = keypair[1];
                    }
                    catch
                    {
                        value = "";
                    }
    
                    songAttribs.Add(keypair[0], keypair[1]);
                }
            }
    
            nowplaying.Title = songAttribs["title"];
            nowplaying.Artist = songAttribs["artist"];
            nowplaying.Duration = 0;
    
            this.label2.Content = "Artist: " + nowplaying.Artist;
            this.label3.Content = "Title: " + nowplaying.Title;
    
            this.label1.Content = playerFeed;
        }
    

    Still working on some of the code but so far things seem to be working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a basic question. I have the basic SL4/RIA project set up and
I have got an(other) error while trying to upgrade our large project to SL4.
I have a custom SL4 app, that fails in a Test Environment. The app
I have a SL4 app that uses WCF to communicate with a backend SQL
Trying to implement a simple print in SL4. I have a DataGrid that I
For our Silverlight Project (SL4) I'm using a Model which might contain Lists (
I have created a silverlight 5 project and added a textbox control to a
I have 3 assemblies, a WP7 app (targeting 7.0), a Web Services project (running
i wanted to implement charts in my silverlight app. i have installed SL4 in
I have this situation in my SL4 application: We create some User Accounts in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.