Re: Problems with sound

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Chris Leffer" <chrisl@xxxxxxxx> wrote in message
news:e9boT$SYFHA.2756@xxxxxxxxxxxxxxxxxxxxxxx
> 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


.


Quantcast