Play Sound File Randomly

Nov 16, 2010

Using JavaScript, I require a code that allows me to play .wav sound files randomly and automatically on page start-up, I also need them to loop as they are drum beats. The plan: to load my web page and hear a random drum beat that loops continuously. I need it to be compatible with most, if not all Internet browsers (Chrome, Internet Explorer, Firefox and Opera are crucial) and to state what sound file is playing on the page (allowing me to identify the looping drum beat/sound file), and if possible to provide a link to the actual sound file for download.

View 15 Replies


ADVERTISEMENT

Play Sound File Like .wav File And / Or DHTML When Some One Mouseover To A Link?

Sep 23, 2008

How to play sound file like .wav file with javascript and/or DHTML when some one mouseover to a link. I have done this... but it only works in IE while it does not work in other browsers like firefox and chrome.

View 4 Replies View Related

Play A .wav Sound File When Someone Hovers Their Mouse/pointer Over An Image?

Feb 13, 2010

I would like to play a .wav sound file when someone hovers their mouse/pointer over an image. I am running a Linux OS.

View 2 Replies View Related

Play Sound After X Seconds?

Jun 25, 2006

I have built an admin area for employees of a business. Once logged-in, if they sit idle for 5 minutes their session will be killed ( the time may vary depending on the employee ). I do all this with php but don't really know much about javascript.

What I would like to do is start playing a small sound repeatedly when the employees session is about 30 seconds from expiring. ( this will give the employee time to click on a link to keep their session alive )

So when the page loads, I would like to pass a length of time in seconds to a javascript. So if the employee can sit idle for 5 minutes, that would be 300 seconds. Minus the 30 seconds that I would like the alarm to be playing for which gives us 270 seconds. ( I'll pass this number to the script with PHP, the script does not have to figure this out... just to be clear. )

So I'm looking for something like this:
- On page load, tell javascript to count down a specific number of seconds ( 270 )
- When the countdown reaches 0, start playing sound file repeatedly.

Sounds easy enough but I haven't been able to find anything like this yet. The only ones I've seen actually display the countdown which I don't want. I want this to count down invisibly. Oh and it should hopefully work in both IE and Firefox.

View 1 Replies View Related

JS Play Sound On Timer

Apr 17, 2011

I know this may sound stupid, but for the life of me I just can't seem to figure out how to code a sound being played every lets say 300 seconds.

View 1 Replies View Related

Make Songs Play From A Button Randomly?

Feb 6, 2011

Basically, I want to make it so there is a button, and when you click it, it plays a random song from a list of songs that would be in the code. I am not completely sure if this is possible or not.

I know how to make the button, that is simple.

View 2 Replies View Related

Play Sound If A Certain Term Exists?

Jun 18, 2010

I don't have a clue what i'm doing with this and don't expect someone to just give me the code if it is actually possible (although it would be nice). I've created a site and in the admin area the page will update and tell me if there is a new message from a user, I have this page automatically refreshing every 5 minutes and wondered if it's possible to play a sound file if the term "unread" appears anywhere on the page?

View 3 Replies View Related

How To Play Sound In A Controlled Manner?

Nov 15, 2010

Which is the best way to play sound using javascript in a controlled manner ? I need a solution which work across all browsers. This is for my bingo game page which is fully based on ajax. :)

View 1 Replies View Related

Play A Short Sound And Then Redirect

Apr 7, 2011

I am coding a page that has 6 buttons on it, from which one is the correct button (the target). I want to try and implement the following:

1) when a wrong button is clicked, the file "wrong.mp3" is played. It is less than a second long.

2) when the correct button is click, the file "right.mp3" is played. It too is less than a second long. The page then redirects/reloads. This is the code that I can't seem to get to work:

[Code]...

View 4 Replies View Related

Play Sound When A Link Is Clicked?

May 25, 2010

I am using a picture as a button for my site and when you click the picture it brings you to the main page of the website. My problem is that I want the button to make a sound when it is clicked on. I figured that Javascript would be the best language to use since I know nothing about Flash.

<html>
<head>
<title>Testing buttons</title>
<script language="javascript" type="text/javascript">
function playSound(soundfile) {

[Code]....

View 9 Replies View Related

Cross Browser Play Sound Button

Sep 7, 2006

Does anyone know how (and if it's possible) to create buttons or text that will play a sound on mousedown/onclick/mouseover?

I've tried the examples on this page - http://www.phon.ucl.ac.uk/home/mark/audio/play.htm#, but the only ones that don't make my I.E. browser crash don't work in Firefox.

View 1 Replies View Related

Swap Image And Play Sound On Mouseover?

Sep 30, 2011

need a script that swap image and play sound on mouseover i already did the swaping image effect but i still need the sound to be played on mouseover .... the link is

View 1 Replies View Related

Play A Sound In Firefox 8 And Internet Explorer 9

Dec 16, 2011

I wrote the following small HTML page, trying to play a sound in Firefox 8 and Internet Explorer 9. The button and the <a></a> link work fine, but calling from the <script></script> tag does nothing. Does anybody know, what can be wrong, and what I can do? I'm sorry, you have to supply the oef.wav file, since I can't upload it.

[Code]....

View 3 Replies View Related

Can I Play A Repetitive Sound And Test Response Time In JS?

Jul 23, 2005

I want to play a repetitive sound, and have a user click on a button each
time it plays (say 5-10 times) and measure how far off he is from the
sound each time.

The only way I know to play a sound in JS is bgsound, and I know how to
loop and pause, so as to do the 1st part. I haven't figured out how to
then test the delay in response. Since some of the responses may also be
*before* the sound plays by some milliseconds, that also compicates it.

My real question is, can this even be done in JS, or should I be in PHP,
ASP, or do you have another suggestion. I'm thinking it needs to run
client-side so there are no network delays, and the results would be
reasonably accurate on different machines. I could easily write it in VB
but I don't want them to have to download anything. I'd just like it to
run from the page.

View 5 Replies View Related

Play A Sound Clip When The User Hovers Over A Link?

Mar 23, 2010

Is it possible to play a small sound clip when the user hovers over a link? Usually the company I work for would use flash to do this but we have been asked to create it in HTML/JavaScript.

View 4 Replies View Related

Auto Sound Play And Stop Coding Depend On Function Output

Jul 26, 2011

I wrote a program which showing the difference of two auto generated values. its working perfectly but when i tried to set if() operator to make sound if the difference higher then 7 its not working.

I think something wrong in my code.

Orginal working code here...

But when i put if() operator under processdata() function the whole things hanged and no sound are palying.

I applied it like this way.

I dont know why its not working....i want to play and stop sound name sample.wav from my harddrive if difference range higher or lower than 7.....

View 1 Replies View Related

How Do I Randomly Select File To RUN

Oct 15, 2009

I have the following code but it simply writes the path to the webpage.I actually want it to randomly select the .js code in that path and run it.

View 1 Replies View Related

Can I Randomly Search An Array In A .js File Not On My Page?

Jan 9, 2007

If I have a .js file filled with data like links. how do i access just
1 element [random] and bring it on my page

View 2 Replies View Related

Make The Source Of A Embedded Sound Switch To Different Sound Files?

Oct 10, 2011

I am trying to use the following code to make the source of a embedded sound switch to different sound files based on which link is clicked:

javascript:
scales=Array("sounds/scales/Mscale.wma", "sounds/scales/hminscale.wma", "sounds/scales/nminscale.wma", "sounds/scales/mminscale.wma", "sounds/scales/chrscale.wma");
function Mscale() {

[Code].....

View 8 Replies View Related

Get An Audible Click Sound File To Run Every Time The Function Runs

Apr 27, 2011

I have a self project I am exploring. I would like to play a simple sound file each time a function is run. The function runs every second, so, basically, I am just trying to get an audible click sound file to run every time the function runs. I do not know how to play a sound file thru javascript. Here is the code file thus far...

<html>
<head>
<title>Timer</title>
<link href="timer.css" rel="stylesheet" type="text/css" />
<embed src="click.wav" autostart=false hidden=true name="sound1" enablejavascript="true">
<script type="text/javascript">
var seconds = 0;
[Code]...

View 7 Replies View Related

Playing A Sound File When A Visitor To Website Moves Their Mouse / Pointer Over A Single Image

Mar 8, 2010

Is it possible to play a sound file when a visitor to my website moves their mouse/pointer over a single image no matter what browser they are using?

View 4 Replies View Related

Play Wav File When Img Or Button Clicked?

Feb 12, 2011

I'm having a problem that I thought would be simple, but it's driving me crazy!I simply want to play a short .wav sound when a button or image is clicked. I have one that plays once when the page opens, but I don't want that. I want the sound to wait for the OnClick.This script I have looks right, but I'm new and don't fully understand how to go about this. If anyone would help me out here, I would solve the Middle East trouble, eliminate the National debt, and find jobs for all the unemployed!Thanks for any guidance, JD ps. I use Chrome & IE

<style type="text/javascript">
<script>
function EvalSound(soundobj) {

[code]....

View 1 Replies View Related

Wait Until The Swf File Is Fully Loaded Then Play It?

May 8, 2010

I have a php page its only work is to display a swf file and after a period of time it redirect automatically to another page. The problem is when the php page loads the swf plays slowly.

What I nead the php file is to wait untill the swf file is fully loaded then play it so it will be played normally in normal speed?

View 3 Replies View Related

Play Audio File At A Certain Time Of A Countdonwn Timer?

Nov 13, 2011

I basically want this timer to count down from 6min 10sec and at certain times (i.e. every minute that it counts down) play an audio file.I got the timer working fine, but getting it to play the audio files (wav files) at specific times is not working...this is the javascript for the timer which works

code:
var sec = 10; // set the seconds
var min = 06; // set the minutes[code].....

View 1 Replies View Related

Play - Pause Button - Play A Constant Loop Of Audio On My Site That Autoplays

Jul 22, 2011

To javascript and have succeeded in getting this code:

Code:

To play a constant loop of audio on my site that autoplays (which i know, typically people hate... but, i'm doing it anyways on this site).

How to add one button in my html body that is CSS style-able that will both pause and then when clicked again resume playing the audio?

View 1 Replies View Related

Youtube Chromeless Player - Videos With An Id That Contains An Underscore Or Dash Don't Play Although They Play In The Normal Player

Dec 11, 2011

I am using the youtube chromeless player and embeding videos with loadVideoById() method problem is that videos with an id that contains an underscore or dash dont play although they play in the normal player. I also tried replacing with a hex value in querystring i.e (%5f) but that did not work I also tried loadVideoByUrl() method with several urls but still they don't load. here is my code

function switchToPlayer(ytid){
var params = { allowScriptAccess: "always"};
var atts = { id: ytid,onmouseover: "this.playVideo()",onmouseout: "this.pauseVideo()"};
swfobject.embedSWF("http://www.youtube.com/apiplayer?border=0&enablejsapi=1&playerapiid="+ytid, 'cell'+ytid, "150", "120", "8", "scripts/expressInstall.swf",null,params,atts);
}
[Code]....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved