ASP.NET - how can i add background sound on asp page

Asked By Dikshan Shah on 13-Sep-12 02:20 AM
I want to play a background sound when i open my aspx page into browser.
which control or code should i use ?
Danasegarane Arunachalam replied to Dikshan Shah on 13-Sep-12 06:36 AM
There are several options available.

1. You can use the bgsound html tag.

Example : http://www.htmlcodetutorial.com/sounds/_BGSOUND.html

2. Free asp.net control from here http://www.aspnetaudio.com/
3. And you can use the embed html tag.

Example
<embed src="myfile.wav" type=”audio/x-wav” />


Jitendra Faye replied to Dikshan Shah on 14-Sep-12 12:15 AM
There are three ways to play background sound in your web page-

1 way.  Using embed tag



The purpose of the <embed> tag is to embed multimedia elements in web page.

The following code fragment displays a MIDI file embedded in a web page


<embed src="beatles.mid" />

2 way. Using object tag



The purpose of the <object> tag is to embed multimedia elements in web page.

The following code fragment displays a WAVE file embedded in a web page.


<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="FileName" value="liar.wav" />
</object>

3 way. Using hyper link


If a web page includes a hyperlink to a media file, most browsers will use a "helper application" to play the file.

The following code fragment displays a link to a MIDI file. If a user clicks on the link, the browser will launch a helper application, like Windows Media Player to play the MIDI file:


 <a href="beatles.mid">Play the Beatles</a>

Use these options and let me know.