Solved

Playing sounds and manipulating sound files

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

856 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