Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question talking clock for fire fox

    this is a talking clock for IE but i want it to work with fire fox, any one knows how?

    <html>
    <head>
    <title>Talking clock javascript example.</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="keywords" content="talking clock, talking clock javascript, javascript, clock javascript, time interval, time spoken.">
    <meta name="description" content="This is an example of the talking clock javascript. The time is spoken at a time interval of 10 seconds. You can set this to whatever time interval you like.">
    </head>

    <body bgcolor="#FFFFFF">
    <script>

    // 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="http://www.**************/games/soundfiles/the_time_is.wav"
    var timer=setTimeout("speakhours()",1200)
    }

    function speakhours() {
    document.all.typesound.src="http://www.**************/games/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="http://www.**************/games/soundfiles/"+minutes+".wav"
    var timer=setTimeout("speakampm()",1200)
    }

    function speakampm() {
    document.all.typesound.src="http://www.**************/games/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="http://www.**************/games/soundfiles/the_time_is.wav" autostart="false" hidden="true">
    <bgsound id="typesound"> </embed>
    </body>
    </html>

  • #2
    New Coder
    Join Date
    Oct 2005
    Location
    Camino, California.
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does Firefox give you an error, or does it simply not talk?

    It is probably out of your control. Mozilla would have to patch their software themselves before a code like this would work.
    Currently designing and coding an entire RPG in VB

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,018
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    document.all restricts the code to IE4+ (only)

    Just for fun, try removing the references to document.all and see what happens when run in Firefox. But remember that in spite of the hype Firefox is only the latest incarnation of the awful Netscape browser.

  • #4
    New Coder
    Join Date
    Oct 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there is no sound in FF, but i have another problem, and it specks only half of the minutes audio file, for EX. if it 5:35 pm, it say its five thirty...pm only without saying thirty five? any ideas. can i change the number in the minutes var from 600 to something else?

  • #5
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by this me View Post
    this is a talking clock for IE but i want it to work with fire fox, any one knows how?
    Not a chance with that code, but under I.E. it displays tha activeX prompt for each sound that it plays. Are you saying that doesn't happen for you?

  • #6
    New Coder
    Join Date
    Oct 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arty Effem View Post
    Not a chance with that code, but under I.E. it displays tha activeX prompt for each sound that it plays. Are you saying that doesn't happen for you?
    i have this code in a toolbar, so you only hear the sound.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •