Solved

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

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

Suggested Solutions

Title # Comments Views Activity
C# GridRow get Old/New Value 1 55
Windows 10 IIS and Windows Authentication to SQL 21 53
Help with sorting data in Listbox using VB.NET 3 53
Error in page 3 44
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 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

20 Experts available now in Live!

Get 1:1 Help Now