473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Problems with sound

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

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
2 1264

"Chris Leffer" <ch****@wank.com> wrote in message
news:e9**************@tk2msftngp13.phx.gbl...
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
Nov 19 '05 #2
Here are the details for a couple different techniques for playing audio
(and video) on web pages:
http://SteveOrr.net/Articles/StreamingMedia.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Chris Leffer" <ch****@wank.com> wrote in message
news:e9**************@tk2msftngp13.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Josh | last post by:
I am having a problem with sound in my program, it takes information from a TargetDataLine, put's it in a temporary file, then takes it back out of the temporary file and plays it using a...
0
by: MLH | last post by:
I just tested a small mde in A97 runtime environment on Win98 box. It has a wav file sound that plays fine on XP box. Does not play on Win 98 box. I get no error msg or anything of the sort. Just...
0
by: Johann Blake | last post by:
Hi, I want to capture a signal from the sound card (via microphone or line input) using the DirectX.Sound.CaptureBuffer class. One of the properties that can be setup prior to capturing is...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
0
by: mike | last post by:
Sound problems resuming from Hibernation I have an MP3 player that plays MP3s off DVD. Uses mci sendstring errreturn = mciSendString("play sound", rs, 128, cb) Been working great for...
2
by: babe6776 | last post by:
Computer - Dell Dimension 3100 Windows XP SP2 Media centre When we bought our computer the sound drivers weren't properly loaded, so my husband reloaded them from the internet. The sound has...
4
by: =?Utf-8?B?TW96YQ==?= | last post by:
Hello... I have Realtek installed but having problems with the Sound.. can anybody help me please?
2
by: hayz | last post by:
Flash sound file looping problems hello there I'm definitely a newb so please bare some patience. I have a flash sound file on the index page of a site i'm working on. First off i need the...
5
by: johnric | last post by:
I can't seem to get firefox to read the image size in my javascript. It will work in IE and firefox but firefox will not read the image size. Can anyone see the problem in my code? I am new to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.