473,748 Members | 2,470 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Play a sound

I need to play a .wav file from my program. I know how to do it from a
regular desktop program but have no idea how to do it from asp.net. My
application regularly plays short (4 seconds or less) wave files depending
on the results of an input. I'm about to start the conversion from the
normal fat client to an asp.net version and the playing of a wav file is
esential. Any ideas?

Rick Lederman
www.soaringsoftware.com
Nov 19 '05 #1
3 6148
Rick Lederman < ri**@soaringsof tware.com > wrote:
I need to play a .wav file from my program. I know how to do it from a
regular desktop program but have no idea how to do it from asp.net. My
application regularly plays short (4 seconds or less) wave files depending
on the results of an input. I'm about to start the conversion from the
normal fat client to an asp.net version and the playing of a wav file is
esential. Any ideas?

This is not something you can accomplish with ASP.NET, per se, as it is
technically can only spit out HTML to a client. Presumably, you will have
to use ASP.NET to output a javascript function to play a sound. Sorry, I
don't know how to do this personally, but google "play sound javascript".
Nov 19 '05 #2

"Rick Lederman" <ri**@soaringso ftware.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I need to play a .wav file from my program. I know how to do it from a
regular desktop program but have no idea how to do it from asp.net. My
application regularly plays short (4 seconds or less) wave files depending
on the results of an input. I'm about to start the conversion from the
normal fat client to an asp.net version and the playing of a wav file is
esential. Any ideas?

Rick Lederman
www.soaringsoftware.com

You can put a <bgsound id="sound1" runat="server"/> on your page and then in
code put the following.

Protected sound1 as htmlgenericcont rol
sound1.attribut es("src") = "../yourwavefile.wa v"

if you want nothing to play then you just reset it to
sound1.attribut es("src") = ""

hope this helps
Mike
Nov 19 '05 #3
Hi Rick,

I think Jeff and Mike's suggestions are reasonable, playing a background
sound is something of the HTML web's capability and in asp.net , we also
make use of that feature. And also, different browsers may have different
html tags or elements to do that. Here is a kb on how to add background
sound in IE:

#How to apply a background sound to a Web page in FrontPage
http://support.microsoft.com/default...b;en-us;297477

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #4

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

Similar topics

2
2532
by: | last post by:
Hi everybody. Need your help. How can I play sound (.wav-file / camera click) on mouseclick? TIA willy wuff _______________________________________________________________________________
1
2719
by: svpsiva | last post by:
How to play sound in j2sdk1.4.2_07??
0
1357
by: yuen | last post by:
How to play sound by C# without using WMP?
0
1845
by: seo gang ho | last post by:
this is my source :$ (tone generator) how to play sound in outputbuffer? please help me...teach me detail...:$ using System;
1
8006
by: Lam | last post by:
how can I play sound file in a .aspx page written in C#? I try to use the code like the following. But whenI call the play function play("sound.wav", this.SND_ASYNC) my computer give out "be" sound instead playing the file (same code works fine in a windows application written in c# , that mean there is nothing wrong with my sound card.) thanks ----------------------------------------------------------------------------...
10
502
by: CM | last post by:
Hi, I used to use the following code to play sound in VB6: Public Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long call sndPlaySound32("c:\WinNt\Media\ding.wav", 0)
1
2641
by: tinmaung | last post by:
hi please help me i want to know how to play sound in java application i don't mean java applet if you can, please send me how to write coding to play sound in application.
1
2355
by: anuvanand1 | last post by:
I am in need of user defined function for Play sound .........
3
2455
by: jamessarvs | last post by:
Windows Media Player cannot play the file because there is a problem with your sound device. There might not be a sound device installed on your computer, it might be in use by another program, or it might not be functioning properly. however it will play sound from the internet What can i do to fix this problem?
1
2591
by: nicolecastel | last post by:
Hello I want to play sound in three external sound cards at the same time,I mean when I click in a button I can hear sound from three speakers which are related to my three sound cards. I have a function but it plays sound only in one device,the first one it finds,I mean in this code the first device is number 0,so it play sound in it,but if you write device number 1 at first,it will play sound in it,as a conclusion it plays sound only in one...
0
8994
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9555
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9329
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4878
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.