Solved

Need to Play Music Files on an ASP.NET Web Page

Posted on 2013-01-02
4
736 Views
Last Modified: 2013-01-08
I need to play wma files on a web page.

I downloaded and installed the ASPNetAudio control.

This is my aspx page:

<br />
                <b>Use this page to select a song.</b>
          <br /><br />
    <ASPNetAudio:Audio ID="Audio1" runat="server" AudioURL="Music/01 He Already Knows.wma">
    </ASPNetAudio:Audio>
   
    <ASPNetMediaGUI:PlayButton ID="PlayButton1" runat="server"
        AssociatedControl="Audio1" MediaURL="~/Music/01 He Already Knows.wma">
   
    </ASPNetMediaGUI:PlayButton>
   
    <ASPNetMediaGUI:VolumeUpButton ID="VolumeUpButton1" runat="server"
        AssociatedControl="Audio1"></ASPNetMediaGUI:VolumeUpButton>
   
    <ASPNetMediaGUI:VolumeDownButton ID="VolumeDownButton1" runat="server"
        AssociatedControl="Audio1"></ASPNetMediaGUI:VolumeDownButton>
         
         
</asp:Content>

Is this control limited to playing wav files?
Is there another control available for playing wma files?

From http://www.c-sharpcorner.com/uploadfile/scottlysle/play-sounds-on-an-asp-net-web-page/


Me.PlayPageSound1.SoundFile = "applaus8.wav"
0
Comment
Question by:Dovberman
  • 3
4 Comments
 
LVL 15

Expert Comment

by:santhimurthyd
ID: 38736216
Could check whether the IIS has the MIME type set for .wma files

Help document on how to manage an MIME type

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/cd72c0dc-c5b8-42e4-96c2-b3c656f99ead.mspx?mfr=true
0
 

Author Comment

by:Dovberman
ID: 38736288
IIS has the MIME type set for .wma files

The wma type is inherited by the web site.
0
 

Accepted Solution

by:
Dovberman earned 0 total points
ID: 38740453
Here is the solution.

Create a HyperLink for each song to play.
The wma file will play in the Windows Media Window when the hyperlink is clicked.

You can populate a listbox that contains the wma file names. In this example the wma files are in the solution/Music folder.

Code:

  public void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ListBox1.SelectedIndex >= 1)
        {
            strPlayListSongName = ListBox1.SelectedItem.ToString();
            HyperLink1.Visible = true;
            HyperLink1.Text = "Click here to play " + strPlayListSongName;
            HyperLink1.NavigateUrl = "~/Music/" + strPlayListSongName + ".wma";
        }
        else
        {
            HyperLink1.Visible = false;
            HyperLink1.Text = "";
        }

    }
0
 

Author Closing Comment

by:Dovberman
ID: 38754070
There were no workable solutions offered after 3 days.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now