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
Solved

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

Posted on 2013-01-02
4
742 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

829 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