Solved

Playing sounds and manipulating sound files

Posted on 2006-10-29
5
152 Views
Last Modified: 2012-08-14
Hi.

Firstly, this is for audible alerts so is a valid reason for having sound on a page :)

I have 2 basic questions.

1. I am getting the name of the particular sound file required by reading an external file. I need this sound to play just once and to be totally embedded in the page and invisible. When it needs to sound i want to use something like

document.getElementById('soundfile').src = "'sounds/"+thissound+".wav'";

to alter the sound according to the value of 'thissound' retreived. I just can't figure out IE/FF code where the required src can be swapped at will. This must be fully cross-browser compatible.

2. Is there any way to retreive a combination of sound files and play one after the other? eg get a file for sound 'Hello' and then another for 'John' and then play them back to back to create 'Hello John'? Obviously I'm simplifying here but just wondered if possible to do.

Many thx





0
Comment
Question by:robertybob
  • 2
5 Comments
 
LVL 30

Expert Comment

by:third
ID: 17830713
0
 

Author Comment

by:robertybob
ID: 17831014
Yup - I found that on Google a while back - problem is none of them work satisfactorily, hence the question here.

However it seems it was a mistake in my element IDs not the JS all sorted anyway.
0
 

Author Comment

by:robertybob
ID: 17831152
ok - all sorted - sry :)

Just simply used a timeout before swapping the sound file again. Would be nice to actually timie it to kick in directly after the previous one has ended but is good enough for the purpose.

0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18016179
PAQed with points refunded (250)

Computer101
EE Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now