Solved

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

Posted on 2013-01-02
4
747 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

688 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