Results 1 to 3 of 3

Thread: Talking Clock - Version 1

  1. #1
    Join Date
    Jan 2016
    Birmingham UK
    Thanked 0 Times in 0 Posts

    Default Talking Clock - Version 1

    This is my very first submission to Dynamic Drive, have used the website since 2005 and been very useful to me over the years and thought id contribute some code my self.

    The following is a Talking Clock (Or SpeakingClock as some people know the service to be)
    This makes use of the speechSynthesis DOM element in newer browsers of Chrome and Firefox, and im lead to believe this also is available on iOS browsers.
    I believe it does not work for IE browsers (Rolls eyes as usual, good old Microsoft)

    This is my first version and is what id consider a rough draft, I worked on it last night and had it running thru out the day reading the correct times.

    Traditional speaking clocks using TTS read the time as 16:45 (Sixteen Forty Five)
    This clock reads the time as a person would usually tell a friend, ie 16:45 = Quarter to Five, 00:00 = Midnight

    The time interval can be adjusted and you can set it to read out as frequent as you want, (Not easy at the moment as this is my first draft) but in time id like to update it once ive made it more jazzy and easier to blend into some ones existing webpage or even have variables that pass that make it easy to configure and set.

    For now if this gets approved, my name is Adam MacKay (UK).
    Thanks you
    Enjoy and hopefully you guys like it

    Revision follows beneath....
    Attached Files Attached Files
    Last edited by devilz_wishbone; 01-24-2016 at 03:13 AM. Reason: Revision

  2. #2
    Join Date
    Jan 2016
    Birmingham UK
    Thanked 0 Times in 0 Posts


    Revision: Version 1.2

    What is new?

    * Error Detection
    * HTML 5 Audio for Beeps (when enabled)
    * Translation
    Previously you could configure the settings to spanish ie: es-ES for the isoLangCode, but it would only read the text as is, for instance "The time is:" would still be "The Time is" just with a spanish reader.
    The new version has had efforts made to cover 4 languages (Spanish, English, French, German) or en-US, en-GB, es-ES, fr-FR, de-DE.

    * 4 Modes

    Millitary (Zero 800 hours) 08:00
    Basic (08:01) = eight: zero one
    Friendly (08:45) = quarter to nine
    Talking Clock = at the next stroke, the time sponsored by accurist will be 8, 45, precisely

    Previously settings was just variables, now the JS file contains 2 main objects
    * Config
    * TTS

    Settings can now be added to the page as follows
    		<script type="text/javascript" src="talkingClock.js"></script>
    				Config.testing = false;
    				Config.testTime = "00:00:00";
    				Config.refreshRate = 100;
    				Config.readOutFrequency = 1;
    				Config.repeatTimePerMinute = 4;
    				Config.volume = 100;
    				Config.readStyle = 2;
    				Config.prefix = "The time now is:";
    				Config.suffix = "";
    				Config.dayState = false;
    				Config.includeSeconds = true;
    				TTS.grabVoices = 10;
    				TTS.voiceToUse = 4;
    				TTS.isoLangCode = "de-DE";
    				TTS.enableBeeps = true;
    				TTS.beeper = TTS.beeperMP3Path;
    Default values
    Error detection

    Time of the day:
    ie: if the time is before mid-day the time will have "in the morning" appended to the reading
    Last edited by Beverleyh; 01-31-2016 at 07:04 PM. Reason: Formatting

  3. #3
    Join Date
    Jan 2016
    Birmingham UK
    Thanked 0 Times in 0 Posts


    Some minor bugs repaired

    Compared to the first release 3 days ago, the script has been entirely re-written
    Whats new?

    * Languages is now an array rather than a switch statement, making the script shorter and easier to configure (Current languages: German, English, French, Spanish)
    * Config and TTS objects created
    * Error Handling
    * 4 Styles (Millitary, Basic, Friendly, TalkingClock style)
    * Bug fix to: Testing, Midnight readings, 10 minutes past readings
    * Beeps (MP3 recording of cordless phone beep)

    Simply replace the existing javascript file with the one included in the attachment
    Attached Files Attached Files

Similar Threads

  1. JS Clock
    By LearningCoder in forum JavaScript
    Replies: 1
    Last Post: 01-12-2011, 03:03 AM
  2. A Clock
    By pwnage in forum JavaScript
    Replies: 0
    Last Post: 06-09-2006, 12:01 PM
  3. dhtml talking to php
    By phytodog in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-20-2005, 04:05 PM


Posting Permissions

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