I have this script and I want it to sit still until I hears a phrase. But, it times out if it waits too long. Is there something I can do to keep this from timing out.
tell application “SpeechRecognitionServer”
activate
set heardPhrase to listen for {“lights on”, “turn off lights”, “call josh”, “quit ichat”, “play music”, “turn music off”}
end tell
activate application "SpeechRecognitionServer"
set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"}
Speech Recognition Suite
Providing access to speech recognition via AppleScript
listen for‚v : Listen for a spoken phrase
listen for list of string : list of possible phrases to listen for
[with prompt string] : text computer will speak as a prompt
[giving up after integer] : how many seconds to wait before giving up
[filtering boolean] : whether to skip phrases with special characters
[displaying list of string] : an optional list of commands to be displayed
→ string : the recognized phrase
listen continuously for‚v : Listen for spoken phrases. Call stop listening when done.
listen continuously for list of string : list of possible phrases to listen for
[with prompt string] : text computer will speak as a prompt
[giving up after integer] : how many seconds to wait before giving up
[filtering boolean] : whether to skip phrases with special characters
[with identifier string] : a unique identifier string for this recognizer
[with section title string] : a section title under which the commands will be listed
[displaying list of string] : an optional list of commands to be displayed
[attach to psn ] : only listen for commands when this application is frontmost
→ string : the recognized phrase
stop listening for identifier‚v : Stop listening when listening continuously
stop listening for identifier string : the unqiue identifier string for the recognizer to stop
tell application "SpeechRecognitionServer" to set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"}
ignoring application responses
tell application "SpeechRecognitionServer" to set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"} to activate
end ignoring
tell application "SpeechRecognitionServer" to set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"} to activate
no luck with these. The script I have works fine if I give it a command. But, if I wait too long, it times out. I think I need a loop that will keep it from timimg out.
what is weird…if you run this, the stop button does not work until it times itself out either. Weird…
tell application "SpeechRecognitionServer"
activate
set heardPhrase to listen for {"lights on", "turn off lights", "call josh", "quit ichat", "play music", "turn music off"}
end tell