Solved

Playing sounds and manipulating sound files

Posted on 2006-10-29
5
151 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

757 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

20 Experts available now in Live!

Get 1:1 Help Now