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].....
How can I play midi and/or audio files using JavaScript? I'm hoping there are some calls/APIs I can use that I am unaware of. My JavaScript book from O'Reilly seems rather lacking in this area.
I'm using VS2008Pro with Master pages. On a child page, I have a modalPopupExtender that calls a panel with an embedded Google video. Everything works great - the popup appears with the video,background greyed.But, when I close the panel,the audio keeps playing in IE 7 & 8. Netscape is fine.I went and tried what Google recommended, but it still continues.
I've got this JavaScript code that I'm using to play audio on my site made specifically for iPhones, iPods, and whatnot. However, my only problem is, that I can only pick one audio file to play from, no matter what. Can someone tell me what I'm doing wrong? I really need this specific code cause it allows me to play audio without going into the Media Player on the iPhone and iPod.
Here's what I have in the head section:
And the body:
And now to actually play the audio:
I can play audio fine, but I'm only limited to one audio file per page. Is there anyway around this??
I'm using a javascript-based countdown timer that currently uses the client's system time to calculate the countdown. I assume that this line of code is where this is performed:
Code:
I'm trying to make the script use server time instead as some people may have wrong dates/times set or live in different time zones etc.
So what I did was use a bit of php:
PHP Code:
This gives a result but now the countdown is 30 days off. I am testing on my local xampp server (which also uses system time) so there should be no discrepancy. I also tried adding
Code:
But no difference.
I can post the whole script if required but it is reasonably long.
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.
I want to play an audio file embedded on my page by clicking on an audio image and the page change to a new page. Is there a cross-browser Javascript way to do this? Right now the code I have is ...
<html> <head> <title>Dictionary: homeostasis</title> <link href="liveink.css" type="text/css" rel="stylesheet"/> </head> <body> <div class="dictionary-area"> <span class="dictionary-word">homeostasis</span> (<span class="dictionary-pos">Noun</span>) <br/> <div class="dictionary-defn">The maintenance of a constant internal state in a changing environment that is maintained by continually making adjustments to the internal and external environment.</div> <a href="homeostasis.mp3" target="new"><img src="audio.gif" border="0"></a> <div class="dictionary-close-window"><a href="javascript:window.close()">Close Window</a></div> </div> </body> </html>
The inconvenience is right now a new window is spawned to play the audio., which contains the controller for playing the audio (complete with pause, stop, and play buttons). All my audio clips are less than 3 seconds in length.. How can I play the audio file without launching the controller? I don't care if there's no way to stop/pause the audio once it's started.
I am developing application in java. here wat i have to do is to highlight words in html file. ie) i have one html file and same content in audio file. when i open the html file audio should play n it should highlight the word in html file on which audio plays. for eg) i have html file with content " hello world". i have same audio file saying "hello world". now when i open html file and click audio, and if audio says hello, hello should highlight in html file, then audio says world, world should highlight in html file. how to do this.
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.
Videos inside tabs play at the same time in IE but works fine in Mozila Firefox : I'm using Simple Tabs with CSS & jQuery but I am having issue with I.E., Chrome I've videos in 3 different tabs, but in I.E & Chrome all tabs starting playing when pages loads but in Mozila Firefox it starts playing when u click on tab. I want each tab to starts works when someone click on it (starts fresh).
Videos inside tabs play at the same time in IE but works fine in Mozila Firefox : I'm using Simple Tabs w/ CSS & jQuery but I’m having issue with I.E , Chrome I’ve videos in 3 different tabs , but in I.E & Chrome all tabs starting playing when pages loads but in Mozila Firefox it starts playing when u click on tab. I want each tab to starts works when someone click on it (starts fresh)
How do I pause the timer so I can maintain the set time and re-start where it left off? Here is most of my code, I removed most of the select options to save space:
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.
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) {
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?
I own a GPT site that offers member Daily SUrveys. When a daily survey is completed, the time of completion is stored in SQL in Unix time format. I hired a guy to code a Countdown timer for me that would be placed next to every completed offer in member's panel and that would show how much time is remaining till the Daily surveys resets and becomes available to the member for completion again(Daily Surveys reset every 24 hours)
When the JS file is not working at the time of Ajax files is called. on first time the onmouseover JS is working but , if you call the ajax JS is not working.
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]....
I'm working on a project where a user is going to click on a name in a list, some code will happen, and then some JavaScript will get a corresponding blob from a server and display it in a new text file.however, the time that the text file is both open and active also needs to be saved. I'm planning on using an ActiveXObject to display the data, but I haven't been able to find anything using either JavaScript or any other language that will be able to see when the user closes the text file or when the text file is active.For this part of the project, the text file is NOT supposed to be open in another web page. Does anyone know how this could be done?
I have a very large tree data structure and I want to display some of its sections on a HTML page. I wrote the following JavaScript that loads parts of the tree dynamically injecting the desired HTML code.
Each show_xxxxxxxx() function displays desired part of the tree on HTML.The problem is each time I load the HTML file it takes a lot of time to read the JavaScript (there are many show_xxxxxxxx() functions with a lot of HTML to insert).Is it possible to cache the loaded JavaScript into browser memory so it won't read the entire script when I reload the page with different content?