Registering and logging in removes this ad.
Registering and logging in removes this ad.
Create a speak the time macro with Vocola?
Submitted by pcconcept on Tue, 04/24/2007 - 17:29.
Is it possible to use the function TTSPlayString or MsgBoxConfirm through Vocola?
I am trying to create a command to "tell" me the time.
This is what I tried using both.
what time is it = MsgBoxConfirm "The current time is %time%", 64 , Time + TTSPlayString
<?php
time
?>Thanks for any help.
Don


If you can do this, it is
If you can do this, it is better to do it in natpython.
Study that first, there are sample macro's for comparable things,
Quintijn
Here some code for an
Here some code for an advanced scripting NaturallySpeaking command. It will speak the time.
Sub Main
Dim sTime As String, iMinute As Integer
Select Case Format( Now, "n" )
Case "15"
sTime = "Quarter past " & Format( Now, "h AMPM" )
Case "30"
sTime = "half past " & Format( Now, "h AMPM" )
Case "45"
sTime = "Quarter to " & Format( DateAdd( "h", 1, Now ), "h AMPM" )
Case "0"
sTime = Format( Now, "h AMPM" )
Case Else
iMinute = Val( Format( Now, "n" ) )
If iMinute < 30 Then
sTime = iMinute & " minutes past " & Format( Now, "h AMPM" )
Else
sTime = 60 - iMinute & " minutes to " & Format( DateAdd( "h", 1, Now ), "h AMPM" )
End If
End Select
' MsgBox sTime
TTSPlayString sTime
End Sub
We cannot tell you how to
We cannot tell you how to do this in Vocola but if you're unable to figure it out, the command already exists in KnowBrainer 2006. All you have to do is say “What Time Is It”. KnowBrainer will visually and verbally tell you the time. 1 of the nice things about KnowBrainer is that many of the commands you would want to create with Vocola already exist in KB 2006. It all boils down to what your time is worth.
KnowBrainer Support Staff - Lunis Orcutt
Dictated with DNS 9, KnowBrainer and UniVoice
Don, This isn't quite what
Don,
This isn't quite what you asked for, but it may be adequate. The following code will open the date/time application in Windows, wait four seconds, and close the date/time application.
ShellExecute "control timedate.cpl", 3
wait 4000
SendSystemKeys "{Alt+F4}"
If you really need to have the time spoken, there are various freeware and shareware utilities that can be found on the Internet that will accomplish this task.
Bruce
This is what I have so
This is what I have so far.
what time is it = SetMicrophone(0) TTSPlayString(%time%) SetMicrophone(1) ;
this will turn off the microphone, play the stream, and then turn the microphone back on.
What I need now is what to insert where %time% is so that it captures the current time.
What it does now is turn off the microphone, actually speak "percent time percent" ,
and turn the microphone back on.
Does anyone know how to get this information?
I have used Google searching for Mac grows and time and come up with multiple different versions
but any symbols I put in there or spoken as a word versus the actual time. Or dragon pops up a message saying that it's unable to play the string.
I have looked at the freeware and shareware utilities that will tell me that time, but that just means one more program running when there has to be a way to do this through vocola in the macro without extra resources being used.
Don
We are not fluent with
We are not fluent with Vocola for obvious reasons but you could create a command that opens Notepad, types the system time into Notepad, copies the text, initiates the text-to-speech engine to read the text and then exits the document without saving. You just have to think outside the box. Of course there's one other option...
KnowBrainer Support Staff - Lunis Orcutt
Dictated with Preferred 9.5 & KnowBrainer
I do not doubt KnowBrainer
I do not doubt KnowBrainer has a good solution for this.
When seeking for something else, consider the natpython script _SmartTTS.py which is designed to read the clipboard. With natpython it is easy to get the current time in desired format on the clipboard. Moreover this script (from Jonathan Epstein) can make better spoken forms by a special translations file, so things that do not fit well in the standard TTS model will sound better.
(I do not know where you can download this grammar file, but I have kept it, so if anybody wants to try..., with consent of Jonathan I hope)
Quintijn
Here is the description:
The notepad hint is what I
The notepad hint is what I needed. I was looking at it las night.
This should work, I can't check it until I get home this evening.
What time is it = ShellExecute "notepad" {F5}{Ctrl+A}{Ctrl+X}{Alt+F4} SetMicrophone(0) TTSPlayString()
SetMicrophone(1) ;
Thanks for the help.
Don
Try this. SetMicrophone
Try this.
SetMicrophone 0
AppBringUp "Notepad"
Wait 1000
SendKeys "{F5}"
Wait 500
SendKeys "{Ctrl+a}"
Wait 1000
HeardWord "read","that"
Wait 6000
SendSystemKeys "{Alt+F4}"
Wait 500
Bruce
I finally got it
I finally got it working.
This is the command as it works now.
what time is it = SetMicrophone(0) AppBringUp (Notepad) {F5}{Ctrl+a}{Ctrl+X}{Alt+F4} TTSPlayString() SetMicrophone(1) ;
Bruce,
I started with what you wrote and kept getting Python errors. I think the problem was I didn't know how to correctly format the command. I read through the vocola global commands and figured out how to format the various commands
I started off with your wait times included and slowly started lowering them until I figured out that it would run with no wait times at all. I had to add the {Ctrl+X} so that it would cut the time out of the page otherwise Notepad would want you to save changes before it would close the document.
This where the page is empty and it will close automatically. And puts the time\date on the clipboard
which is read by the TTSPlayString() command.
If you try this command and it doesn't work properly you might have to add the wait times back in.
I guess it depends on how fast your computer is.
Thanks for all the help, I love this forum.
Don
In natpython years ago a
In natpython years ago a small grammar was written by Jonathan Epstein that read text that was put on the clipboard. No intermediate windows necessary. With python it is easy to put the date/time in the format you want on the clipboard.
As additional feature a list of words can be defined with additional "wanted spoken form" in order to make some words or abbreviations sound nicer. I do not know where the grammar can be downloaded, but if somebody wants to try it: it is still on my computer. I hope Jonathan agrees with this message. Below the readme text.
Greetings, Quintijn