Post by =BGOAT=Hypnotic on May 11, 2004 5:39:11 GMT -5
[glow=red,2,300]Step 1: Open your webpage. Paste the following code right before the </body> tag of your webpage:[/glow]
<script>
// CREDITS:
// Speaking clock
// by Urs Dudli and Peter Gehrig
// Copyright (c) 2003 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at www.24fun.com
// info@24fun.com
// 3/25/2003
// IMPORTANT:
// If you add this script to a script-library or a script-archive
// you have to insert a link to www.24fun.com
// right into the webpage where the script will be displayed.
// Edit speaking interval (seconds)
var speakinginterval=10
// Do not edit the code below this line
var thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var ampm
speakinginterval=1000*speakinginterval
if (hours<12) {
ampm="am"
}
else if (hours>=12) {
ampm="pm"
if (hours!=12) {
hours=hours-12
}
}
function speakthetimeis() {
document.all.typesound.src="soundfiles/the_time_is.wav"
var timer=setTimeout("speakhours()",1200)
}
function speakhours() {
document.all.typesound.src="soundfiles/"+hours+".wav"
if (minutes<10) {
var timer=setTimeout("speakzerominutes()",1200)
}
else {
var timer=setTimeout("speakminutes()",1200)
}
}
function speakzerominutes() {
document.all.typesound.src="soundfiles/0.wav"
var timer=setTimeout("speakminutes()",600)
}
function speakminutes() {
document.all.typesound.src="soundfiles/"+minutes+".wav"
var timer=setTimeout("speakampm()",1200)
}
function speakampm() {
document.all.typesound.src="soundfiles/"+ampm+".wav"
thistime= new Date()
hours=thistime.getHours()
minutes=thistime.getMinutes()
if (hours<12) {
ampm="am"
}
else if (hours>=12) {
ampm="pm"
if (hours!=12) {
hours=hours-12
}
}
var content="<embed src=\"soundfiles/"+hours+".wav\" autostart=\"false\" hidden=\"true\">"
content+="<embed src=\"soundfiles/"+minutes+".wav\" autostart=\"false\" hidden=\"true\">"
soundcontainer.innerHTML=content
var timer=setTimeout("speakthetimeis()",speakinginterval)
}
if (document.all) {
document.write("<span id=\"soundcontainer\" style=\"position:relative;\">")
document.write("<embed src=\"soundfiles/"+hours+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("<embed src=\"soundfiles/"+minutes+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("<embed src=\"soundfiles/"+ampm+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("</span>")
document.write("<embed src=\"soundfiles/0.wav\" autostart=\"false\" hidden=\"true\">")
document.write("</span>")
window.onload=speakthetimeis
}
</script>
<embed src="soundfiles/the_time_is.wav" autostart="false" hidden="true">
<bgsound id="typesound">
[glow=red,2,300]Step 2: Download the zipped file www.freedone.com/downloadcenter/clockspeak/soundzip.zip and extract the folder soundfiles[/glow]
[glow=red,2,300]Step 3: Put the folder soundfiles into the same folder as the webpage that contains the code for your speaking clock.[/glow]
[glow=red,2,300]Step 4: Set the speaking interval on top of the script. In this sample the speaking interval is set to 10 seconds[/glow]
<script>
// CREDITS:
// Speaking clock
// by Urs Dudli and Peter Gehrig
// Copyright (c) 2003 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at www.24fun.com
// info@24fun.com
// 3/25/2003
// IMPORTANT:
// If you add this script to a script-library or a script-archive
// you have to insert a link to www.24fun.com
// right into the webpage where the script will be displayed.
// Edit speaking interval (seconds)
var speakinginterval=10
// Do not edit the code below this line
var thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var ampm
speakinginterval=1000*speakinginterval
if (hours<12) {
ampm="am"
}
else if (hours>=12) {
ampm="pm"
if (hours!=12) {
hours=hours-12
}
}
function speakthetimeis() {
document.all.typesound.src="soundfiles/the_time_is.wav"
var timer=setTimeout("speakhours()",1200)
}
function speakhours() {
document.all.typesound.src="soundfiles/"+hours+".wav"
if (minutes<10) {
var timer=setTimeout("speakzerominutes()",1200)
}
else {
var timer=setTimeout("speakminutes()",1200)
}
}
function speakzerominutes() {
document.all.typesound.src="soundfiles/0.wav"
var timer=setTimeout("speakminutes()",600)
}
function speakminutes() {
document.all.typesound.src="soundfiles/"+minutes+".wav"
var timer=setTimeout("speakampm()",1200)
}
function speakampm() {
document.all.typesound.src="soundfiles/"+ampm+".wav"
thistime= new Date()
hours=thistime.getHours()
minutes=thistime.getMinutes()
if (hours<12) {
ampm="am"
}
else if (hours>=12) {
ampm="pm"
if (hours!=12) {
hours=hours-12
}
}
var content="<embed src=\"soundfiles/"+hours+".wav\" autostart=\"false\" hidden=\"true\">"
content+="<embed src=\"soundfiles/"+minutes+".wav\" autostart=\"false\" hidden=\"true\">"
soundcontainer.innerHTML=content
var timer=setTimeout("speakthetimeis()",speakinginterval)
}
if (document.all) {
document.write("<span id=\"soundcontainer\" style=\"position:relative;\">")
document.write("<embed src=\"soundfiles/"+hours+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("<embed src=\"soundfiles/"+minutes+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("<embed src=\"soundfiles/"+ampm+".wav\" autostart=\"false\" hidden=\"true\">")
document.write("</span>")
document.write("<embed src=\"soundfiles/0.wav\" autostart=\"false\" hidden=\"true\">")
document.write("</span>")
window.onload=speakthetimeis
}
</script>
<embed src="soundfiles/the_time_is.wav" autostart="false" hidden="true">
<bgsound id="typesound">
[glow=red,2,300]Step 2: Download the zipped file www.freedone.com/downloadcenter/clockspeak/soundzip.zip and extract the folder soundfiles[/glow]
[glow=red,2,300]Step 3: Put the folder soundfiles into the same folder as the webpage that contains the code for your speaking clock.[/glow]
[glow=red,2,300]Step 4: Set the speaking interval on top of the script. In this sample the speaking interval is set to 10 seconds[/glow]