Problems with sound

C

Chris Leffer

Hi.

I have a page that plays a .wav file from time to time, when the page
loads. Some of my customers say that the sound does not play and others
say that the sound plays very well. All of my customers are using
Internet Explorer 6.0+ .
What is the best or correct way to play a sound file from an asp.net
page? That's the code I am using:

Protected WithEvents plhSound As PlaceHolder

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim embWarning As New HtmlGenericControl("embed")

With embAlerta.Attributes
.Add("src", "warn.wav")
.Add("autostart", "true")
.Add("type", "audio/wav")
.Add("width", "0")
.Add("height", "0")
.Add("volume", "0")
End With
plhSound.Controls.Add(embWarning)

End Sub


Regards,
Chris Leffer
 
V

vMike

Chris Leffer said:
Hi.

I have a page that plays a .wav file from time to time, when the page
loads. Some of my customers say that the sound does not play and others
say that the sound plays very well. All of my customers are using
Internet Explorer 6.0+ .
What is the best or correct way to play a sound file from an asp.net
page? That's the code I am using:

Protected WithEvents plhSound As PlaceHolder

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim embWarning As New HtmlGenericControl("embed")

With embAlerta.Attributes
.Add("src", "warn.wav")
.Add("autostart", "true")
.Add("type", "audio/wav")
.Add("width", "0")
.Add("height", "0")
.Add("volume", "0")
End With
plhSound.Controls.Add(embWarning)

End Sub


Regards,
Chris Leffer
I use <bgsound id="sound1" runat="server"/> in my page and
Protected sound1 as htmlgenericcontrol

sound1.visible = false
or
sound1.visible = true
sound1.attributes("src") = "somesoundfile.wav"

depending on whether I want it to play or not.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top