Menu

greet me

Aaron
2016-01-16
2016-02-20
  • Aaron

    Aaron - 2016-01-16

    Using the natural delay in Sapi.speek seems to make the words flow better.
    Also little things like "P.M." = "P dot M", so I use "P M."

    Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
    Set Sapi2 = Wscript.CreateObject("SAPI.SpVoice")
    dim str,spoke

    if hour(time) < 12 then
    spoke=spoke & "Good Morning Aaron"
    else
    if hour(time) > 12 then
    if hour(time) > 16 then
    spoke=spoke & "Good eeevening Aaron"
    else
    spoke=spoke & "Good afternoon Aaron"
    end if
    end if
    end if

    Sapi2.speak spoke
    spoke=""

    spoke=spoke & "The current time is "

    'Sapi2.speak spoke
    'spoke=""

    if hour(time) > 12 then
    spoke=spoke & hour(time)-12
    else
    if hour(time) = 0 then
    spoke=spoke & "12"
    else
    spoke=spoke & hour(time)
    end if
    end if

    'Sapi2.speak spoke
    'spoke=""
    spoke=spoke & " "

    if minute(time) < 10 then
    spoke=spoke & "o"
    if minute(time) < 1 then
    spoke=spoke & "clock"
    else
    spoke=spoke & minute(time)
    end if
    else
    spoke=spoke & minute(time)
    end if

    Sapi2.speak spoke
    spoke=""

    if hour(time) > 12 then
    spoke=spoke & "P M."
    else
    if hour(time) = 0 then
    if minute(time) = 0 then
    spoke=spoke & "Midnight"
    else
    spoke=spoke & "A.M."
    end if
    else
    if hour(time) = 12 then
    if minute(time) = 0 then
    spoke=spoke & "Noon"
    else
    spoke=spoke & "P M."
    end if
    else
    spoke=spoke & "A M."
    end if
    end if
    end if
    Sapi.speak spoke

     
    • Abhishek Dubey

      Abhishek Dubey - 2016-02-20

      your script is fine , but it has much complexity and when we have to add more features to it , it becomes a difficult task !

       

      Last edit: Abhishek Dubey 2016-02-20

Log in to post a comment.