Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-01-02
4
Medium Priority
?
759 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

Industry Leaders: 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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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.…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

609 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