Jump to content

Basic speech recognition.


JRowe
 Share

Recommended Posts

I wrestled with this one for a few days, but finally got the basics figured out. You need a microphone plugged into your computer (not a USB mic or you'll have to configure the app for it.)

If you don't have SAPI, you can download 5.1 here. Try the script before, it seems SAPI gets distributed with most Vista and 7 versions.

This listens to what you say into the mic, runs it through the windows speech recognition engine, and outputs the results to console. Results improve the more you train the system. I'm getting decent accuracy after about an hour of training. This uses a localized speech recognition engine, meaning that it's not subject to the Vista/7 built in Speech Recognition tool. This means you can add it into your app for your own commands, and it won't capture the basic Speech commands. There are ways of specifying grammars, utilizing the training tools, and other intricacies I haven't got to yet.

Thanks to ProgAndy, cyberZeroCool, seangriffin, and all the others who've done SAPI work, you guys have blazed the trails for some very fun stuff.

Global $h_Context = ObjCreate("SAPI.SpInProcRecoContext")
Global $h_Recognizer = $h_Context.Recognizer
Global $h_Grammar = $h_Context.CreateGrammar(1)
$h_Grammar.Dictationload
$h_Grammar.DictationSetState(1)

;Create a token for the default audio input device and set it
Global $h_Category = ObjCreate("SAPI.SpObjectTokenCategory")
$h_Category.SetId("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput\TokenEnums\MMAudioIn\")
Global $h_Token = ObjCreate("SAPI.SpObjectToken")
$h_Token.SetId("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput\TokenEnums\MMAudioIn\")
$h_Recognizer.AudioInput = $h_Token

Global $i_ObjInitialized = 0

Global $h_ObjectEvents = ObjEvent($h_Context, "SpRecEvent_")
If @error Then
    ConsoleWrite("ObjEvent error: " & @error & @CRLF)
    $i_ObjInitialized = 0
Else
    ConsoleWrite("ObjEvent created Successfully!" & @CRLF)
    $i_ObjInitialized = 1
EndIf

While $i_ObjInitialized
    Sleep(5000)
    ;Allow the Audio In to finalize processing on the last 5 second capture
    $h_Context.Pause
    ;Resume audio in processing
    $h_Context.Resume
    ;Reset event function allocation (what is this? I think its garbage collection or something, needs clarification)
    $h_ObjectEvents = ObjEvent($h_Context, "SpRecEvent_")
WEnd

Func SpRecEvent_Hypothesis($StreamNumber, $StreamPosition, $Result)
    ConsoleWrite("Hypothesis(): Hypothized text is: " & $Result.PhraseInfo.GetText & @CRLF)
EndFunc ;==>SpRecEvent_Hypothesis

Func SpRecEvent_Recognition($StreamNumber, $StreamPosition, $RecognitionType, $Result)
    ConsoleWrite($RecognitionType & "||" & $Result.PhraseInfo.GetText & @CRLF)
EndFunc ;==>SpRecEvent_Recognition

Func SpRecEvent_SoundStart($StreamNumber, $StreamPosition)
    ConsoleWrite("Sound Started" & @CRLF)
EndFunc ;==>SpRecEvent_SoundStart

Func SpRecEvent_SoundEnd($StreamNumber, $StreamPosition)
    ConsoleWrite("Sound Ended" & @CRLF)
EndFunc ;==>SpRecEvent_SoundEnd

The SoundEnd event doesn't appear to work. Everything else functions as intended. In order to use this, you have to parse completed phrases from the input. Don't worry about the Sleep(5000), that doesn't interfere with the operation of the recognition. That's just there to separate the sound input into manageable chunks. It's not in UDF format, but should be very easy to adapt into your projects.

A hypothesis is the engine's best guess as to what is being said. A recognition is a finalized hypothesis. After a recognition, any new input will be hypothesized until discarded or recognized. You can talk for as long as you want and it will piece together what is said, until there is a full 1 second gap in the incoming audio.

Here is the SAPI recognition documentation if you want to modify this for your own purposes. Have fun!

Edited by JRowe
Link to comment
Share on other sites

Interesting work!

Just for clarification, which version do you download? I prefer to download the bare minimum to get it working (unless the extra files will improve it somehow)?

EDIT: Is it possible to determine what SAPI version is installed?

Edited by DJKMan

 

 

Link to comment
Share on other sites

The SAPI SDK, its a 68 MB download. I'll take a look at how to get the SAPI version - I haven't really delved into the breadth of the available api calls, I just wanted to get the basic dictation working. I'm guessing there will be a command like SAPI.GetVersion somewhere.

Grammar creation and custom training on those grammars is also on my to-do list, but those will wait until after au3irrlicht gets updated, which gets superseded by work. :mellow:

Link to comment
Share on other sites

  • 3 months later...

The 'garbage collection' is an eventhandler telling SAPI to link any event created (like Recognition) to your function (SpRecEvent_Recognition). You specify the function names prefix and SAPI knows which function to call in case of the related event.

Its a nice example but I wouldn't put the eventhandler call in the while/wend loop. Best case it works, worst case it creates endless instances of the event handler.

Another recommendation is to use the appropriate SAPI filter for the interesting events. In my case the recognition didn't work for a very long time and crashed, only using the appropriate filtering of SAPI events could solve the problem. Maybe your SoundEnd problem is related to this.

Link to comment
Share on other sites

  • 1 month later...

Thats very exciting project :graduated:

I have a microphone and I'm installed the SDK and i've got vista Ultimate X86 but if I try run the code; I'm getting error like this:

...Speech Recognition.au3 (2) : ==> Variable must be of type "Object".:
Global $h_Recognizer = $h_Context.Recognizer
Global $h_Recognizer = $h_Context^ ERROR
->20:49:22 AutoIT3.exe ended.rc:1
>Exit code: 1    Time: 1.688

the error is in there:

Global $h_Context = ObjCreate("SAPI.SpInProcRecoContext")
Global $h_Recognizer = $h_Context.Recognizer
Global $h_Grammar = $h_Context.CreateGrammar(1)
$h_Grammar.Dictationload
$h_Grammar.DictationSetState(1)
Edited by BiliyomKi
An AutoIT user.
Link to comment
Share on other sites

Nice! I can get some words to work great, others not at all.. however I'm definitely thinking of hooking this up with a few key things I use a lot on my computer.. say "mail" to open gmail, or music to open foobar.. other random things: "shut down", "watermelon" (key word to tell my computer to get rid of all incriminating files :graduated:), "number calc".. et cetera.. actually I might do that right now and post here just so people can see more.. or I might go to bed..

Just change the SpRecEvent_Recognize function to this.. I was surprised by how little I had to add:

Func SpRecEvent_Recognition($StreamNumber, $StreamPosition, $RecognitionType, $Result)
    $temp = $Result.PhraseInfo.GetText
    ConsoleWrite($RecognitionType & "||" & $Result.PhraseInfo.GetText & @CRLF)
    Switch $temp
        Case 'mail'
            ShellExecute('www.gmail.com')
        Case 'music'
            Run('C:\Program Files (x86)\foobar2000\foobar2000.exe')
        Case 'number'
            Run('calc.exe')
    EndSwitch
EndFunc ;==>SpRecEvent_Recognition
Edited by Achilles
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 1 month later...

thanks for this code...i used code of yours which is inside the while loop and now my script fine..but showing some kind of error after compilation..i have put it in the help and support forum..

[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Link to comment
Share on other sites

  • 4 months later...

...Speech Recognition.au3 (2) : ==> Variable must be of type "Object".:
Global $h_Recognizer = $h_Context.Recognizer
Global $h_Recognizer = $h_Context^ ERROR
->20:49:22 AutoIT3.exe ended.rc:1
>Exit code: 1    Time: 1.688

the error is in there:

Global $h_Context = ObjCreate("SAPI.SpInProcRecoContext")
Global $h_Recognizer = $h_Context.Recognizer
Global $h_Grammar = $h_Context.CreateGrammar(1)
$h_Grammar.Dictationload
$h_Grammar.DictationSetState(1)

I get the same problem!

Can anyone help me ?

Edit: My control panel says:

"Speak recognition not avilable for the current language"

Is this the problem, and can you override it ?

Edited by Maffe811

[font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]

Link to comment
Share on other sites

  • 11 months later...

Hello guys i just got started on Speech recognition and TTS and found some helpful scripts on the

forum i moddified them and came up with this:

Global $h_Context = ObjCreate("SAPI.SpInProcRecoContext")
Global $h_Recognizer = $h_Context.Recognizer
Global $h_Grammar = $h_Context.CreateGrammar(1)
$h_Grammar.Dictationload
$h_Grammar.DictationSetState(1)
Global $voice = ObjCreate("SAPI.SpVoice")
global $text = 0
Global $times = 0
Global $times2 = 1
Global $PF = @ProgramFilesDir
;Create a token for the default audio input device and set it
Global $h_Category = ObjCreate("SAPI.SpObjectTokenCategory")
$h_Category.SetId("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput\TokenEnums\MMAudioIn\")
Global $h_Token = ObjCreate("SAPI.SpObjectToken")
$h_Token.SetId("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\AudioInput\TokenEnums\MMAudioIn\")
$h_Recognizer.AudioInput = $h_Token
Global $i_ObjInitialized = 0
Global $h_ObjectEvents = ObjEvent($h_Context, "SpRecEvent_")
If @error Then  
ConsoleWrite("ObjEvent error: " & @error & @CRLF)   
$i_ObjInitialized = 0
Else    
ConsoleWrite("ObjEvent created Successfully!" & @CRLF)  
$i_ObjInitialized = 1
EndIf
While $i_ObjInitialized 
Sleep(5000)  ;Allow the Audio In to finalize processing on the last 5 second capture    
$h_Context.Pause     ;Resume audio in processing    
$h_Context.Resume    ;Reset event function allocation (what is this? I think its garbage collection or something, needs clarification)  
$h_ObjectEvents = ObjEvent($h_Context, "SpRecEvent_")
WEnd
Func SpRecEvent_Hypothesis($StreamNumber, $StreamPosition, $Result) 
ConsoleWrite("Hypothesis(): Hypothized text is: " & $Result.PhraseInfo.GetText & @CRLF)
EndFunc ;==>SpRecEvent_Hypothesis
Func SpRecEvent_Recognition($StreamNumber, $StreamPosition, $RecognitionType, $Result)  
ConsoleWrite($RecognitionType & "||" & $Result.PhraseInfo.GetText & @CRLF)
if $Result.PhraseInfo.GetText = "jarvis" and $times = not 1 Then
call("jarvis")
EndIf
if $times = 1 and $times2 = 0 Then
  $q1 = $Result.PhraseInfo.GetText;InputBox("question for jarvis", "")
  call("Aknowledge",$q1)
EndIf
EndFunc ;==>SpRecEvent_Recognition
Func SpRecEvent_SoundStart($StreamNumber, $StreamPosition)  
ConsoleWrite("Sound Started" & @CRLF)
EndFunc ;==>SpRecEvent_SoundStart
Func SpRecEvent_SoundEnd($StreamNumber, $StreamPosition)    
ConsoleWrite("Sound Ended" & @CRLF)
EndFunc ;==>SpRecEvent_SoundEnd

func jarvis()
$string = "Sir?"
$Voice.Speak($string,11)
Sleep(500)
$times = 1
$times2 = 0
;$q1 = $Result.PhraseInfo.GetText;InputBox("question for jarvis", "")
;call("Aknowledge",$q1)
EndFunc
func aknowledge($q1)
Select
case $q1 = "Open mail"
   Call("open_mail")
case $q1 = "Close mail"
   call("close_mail")
case $q1 = "get time"
   $text = ", the time is " & @hour & " hours " & @min & " minutes"
   $times2 = 1
case $q1 = "get date"
   call("get_date")
case $q1 = "goodbye"
   call("Good_bye")
case $q1 = "go to sleep"
   $text = "going to sleep"
case $q1 = "start team speak"
   call("open_teamspeak")
case $q1 = "close team speak"
   call("close_teamspeak")
case $q1 = "lights on all"
  Call("Lights_on_all")
case $q1 = "lights off all"
  call("Lights_off_all")
case $q1 = ""
  $text = "sorry you haven't specified what you wanted from me"
EndSelect
if $text = not 0 then
$string = "of course Sir " & $text
$Voice.Speak($string,11)
Sleep(2000)
$times = 0
endif
;select
;case $q1 = "good bye"
;exit
;case $q1 = "go to sleep"
;WinSetState("J.A.R.V.I.S 1.0 Beta","" ,@SW_MINIMIZE)
;EndSelect  
$q1 = 0
$text = 0
EndFunc
func good_bye()
$t1 = @HOUR
select
case $t1 >= 12 and $t1 < 18
  $text = "have a nice afternoon"
case $t1 < 12 and $t1 > 5
  $text = "have a nice day"
case $t1 > 18 and $t1 < 23
  $text = "have a pleasant night"
EndSelect
$times2 = 1
;MsgBox(0, "test", $text) ; encoutered problems with $text variable
; the variable doesn't get returned to the speech part
;made variable $text a global and this resolved the problem
   endfunc
func open_mail()
$text = "opening your'e mail now"
run("C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.exe")
winwaitactive("Inbox")
$times2 = 1
EndFunc

func close_mail()
$p1 =ProcessExists("OUTLOOK.EXE")
if $p1 = 0 Then
$text = ", you have no mail programm running"
else
   $text = "closing your'e mail"
   ProcessClose("OUTLOOK.EXE")
EndIf
$times2 = 1
EndFunc
func open_teamspeak()
   $text = "starting Team Speak"
   ;run($PF &"\FalNET G19 Display Manager\FalNET G19 Display Manager.exe")
   WinWaitActive("FalNET G19 Display Manager", "")
   WinSetState("FalNET G19 Display Manager", "",@SW_MINIMIZE)
   run($PF &"\TeamSpeak 3 Client\ts3client_win64.exe")
   WinWaitActive("TeamSpeak 3", "")
   Send("^s")
   WinWaitActive("Connect", "")
   send("{enter}")
$times2 = 1
EndFunc
func close_teamspeak()
$text = "closing Team Speak"
$p1 = ProcessExists("ts3client_win64.exe")
$p2 = ProcessExists("FalNET G19 Display Manager.exe")
if $p1 = 0 Then
   $text = "no Team Speak running"
Else
   ProcessClose("ts3client_win64.exe")
   ;WinSetState("TeamSpeak3", " ",@sw_show)
  
EndIf
if $p2 = 0 then
Else
   ProcessClose("FalNET G19 Display Manager.exe")
EndIf
$times2 = 1
EndFunc
func get_date()
$year = @YEAR
$month1 =@MON
$day1 = @MDAY
$day2 = @WDAY
; converting day number to the name of that day
Select
Case $day2 = 1
   $day3 = "Sunday"
Case $day2 = 2
   $day3 = "monday"
case $day2 = 3
   $day3 = "Tuesday"
case $day2 = 4
   $day3 = "wensday"  
Case $day2 = 5
   $day3 = "Thursday"
Case $day2 = 6
   $day3 = "Friday"
case $day2 = 7
   $day3 = "Saturday"
EndSelect
;converting number of month to name of that month
Select
Case $month1 = 01
   $month2 = "January"
Case $month1 = 02
   $month2 = "February"
Case $month1 = 03
   $month2 = "March"
Case $month1 = 04
   $month2 = "April"
Case $month1 = 05
   $month2 = "May"
Case $month1 = 06
   $month2 = "June"
Case $month1 = 07
   $month2 = "July"
Case $month1 = 08
   $month2 = "August"
Case $month1 = 09
   $month2 = "September"
Case $month1 = 10
   $month2 = "October"
Case $month1 = 11
   $month2 = "November"
Case $month1 = 12
   $month2 = "December"
EndSelect  
$text = "The date is: " & $day3 & " "& $day1 & " of " & $month2 & " " & $year
$times2 = 1
EndFunc
; the Lights functions will grow when i figured out how to
; combine this programm with my lighting scheme
func Lights_on_all()
$text = " Turning all lights on"
EndFunc
func Lights_off_all()
$text = " turning all lights off"
EndFunc

used a Virtual Machine with XP pro to test the speech recognition, this because my version of win7 ultimate is Dutch and does not support speech recognition.

can some one verrify that this also works on Win7?

if so please leave me a PM.

oh and let me know what you guys think of it ;)

Edit: iv'e added the source file

speech.au3

Edited by vtuls

a badly written code is better than a unwritten onea good written code is even better.but there is always room for improvement. :)

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Hello guys i just got started on Speech recognition and TTS and found some helpful scripts on the

forum i moddified them and came up with this:

Global $h_Context = ObjCreate("SAPI.SpInProcRecoContext")
Global $h_Recognizer = $h_Context.Recognizer
Global $h_Grammar = $h_Context.CreateGrammar(1)
$h_Grammar.Dictationload
$h_Grammar.DictationSetState(1)
Global $voice = ObjCreate("SAPI.SpVoice")
global $text = 0
Global $times = 0
Global $times2 = 1
Global $PF = @ProgramFilesDir
;Create a token for the default audio input device and set it
Global $h_Category = ObjCreate("SAPI.SpObjectTokenCategory")
$h_Category.SetId("HKEY_LOCAL_MACHINESOFTWAREMicrosoftSpeechAudioInputTokenEnumsMMAudioIn")
Global $h_Token = ObjCreate("SAPI.SpObjectToken")
$h_Token.SetId("HKEY_LOCAL_MACHINESOFTWAREMicrosoftSpeechAudioInputTokenEnumsMMAudioIn")
$h_Recognizer.AudioInput = $h_Token
Global $i_ObjInitialized = 0
Global $h_ObjectEvents = ObjEvent($h_Context, "SpRecEvent_")
If @error Then  
ConsoleWrite("ObjEvent error: " & @error & @CRLF)   
$i_ObjInitialized = 0
Else    
ConsoleWrite("ObjEvent created Successfully!" & @CRLF)  
$i_ObjInitialized = 1
EndIf
While $i_ObjInitialized 
Sleep(5000)  ;Allow the Audio In to finalize processing on the last 5 second capture    
$h_Context.Pause     ;Resume audio in processing    
$h_Context.Resume    ;Reset event function allocation (what is this? I think its garbage collection or something, needs clarification)  
$h_ObjectEvents = ObjEvent($h_Context, "SpRecEvent_")
WEnd
Func SpRecEvent_Hypothesis($StreamNumber, $StreamPosition, $Result) 
ConsoleWrite("Hypothesis(): Hypothized text is: " & $Result.PhraseInfo.GetText & @CRLF)
EndFunc ;==>SpRecEvent_Hypothesis
Func SpRecEvent_Recognition($StreamNumber, $StreamPosition, $RecognitionType, $Result)  
ConsoleWrite($RecognitionType & "||" & $Result.PhraseInfo.GetText & @CRLF)
if $Result.PhraseInfo.GetText = "jarvis" and $times = not 1 Then
call("jarvis")
EndIf
if $times = 1 and $times2 = 0 Then
$q1 = $Result.PhraseInfo.GetText;InputBox("question for jarvis", "")
call("Aknowledge",$q1)
EndIf
EndFunc ;==>SpRecEvent_Recognition
Func SpRecEvent_SoundStart($StreamNumber, $StreamPosition)  
ConsoleWrite("Sound Started" & @CRLF)
EndFunc ;==>SpRecEvent_SoundStart
Func SpRecEvent_SoundEnd($StreamNumber, $StreamPosition)    
ConsoleWrite("Sound Ended" & @CRLF)
EndFunc ;==>SpRecEvent_SoundEnd

func jarvis()
$string = "Sir?"
$Voice.Speak($string,11)
Sleep(500)
$times = 1
$times2 = 0
;$q1 = $Result.PhraseInfo.GetText;InputBox("question for jarvis", "")
;call("Aknowledge",$q1)
EndFunc
func aknowledge($q1)
Select
case $q1 = "Open mail"
Call("open_mail")
case $q1 = "Close mail"
call("close_mail")
case $q1 = "get time"
$text = ", the time is " & @hour & " hours " & @min & " minutes"
$times2 = 1
case $q1 = "get date"
call("get_date")
case $q1 = "goodbye"
call("Good_bye")
case $q1 = "go to sleep"
$text = "going to sleep"
case $q1 = "start team speak"
call("open_teamspeak")
case $q1 = "close team speak"
call("close_teamspeak")
case $q1 = "lights on all"
Call("Lights_on_all")
case $q1 = "lights off all"
call("Lights_off_all")
case $q1 = ""
$text = "sorry you haven't specified what you wanted from me"
EndSelect
if $text = not 0 then
$string = "of course Sir " & $text
$Voice.Speak($string,11)
Sleep(2000)
$times = 0
endif
;select
;case $q1 = "good bye"
;exit
;case $q1 = "go to sleep"
;WinSetState("J.A.R.V.I.S 1.0 Beta","" ,@SW_MINIMIZE)
;EndSelect
$q1 = 0
$text = 0
EndFunc
func good_bye()
$t1 = @HOUR
select
case $t1 >= 12 and $t1 < 18
$text = "have a nice afternoon"
case $t1 < 12 and $t1 > 5
$text = "have a nice day"
case $t1 > 18 and $t1 < 23
$text = "have a pleasant night"
EndSelect
$times2 = 1
;MsgBox(0, "test", $text) ; encoutered problems with $text variable
; the variable doesn't get returned to the speech part
;made variable $text a global and this resolved the problem
endfunc
func open_mail()
$text = "opening your'e mail now"
run("C:Program Files (x86)Microsoft OfficeOffice14OUTLOOK.exe")
winwaitactive("Inbox")
$times2 = 1
EndFunc

func close_mail()
$p1 =ProcessExists("OUTLOOK.EXE")
if $p1 = 0 Then
$text = ", you have no mail programm running"
else
$text = "closing your'e mail"
ProcessClose("OUTLOOK.EXE")
EndIf
$times2 = 1
EndFunc
func open_teamspeak()
$text = "starting Team Speak"
;run($PF &"FalNET G19 Display ManagerFalNET G19 Display Manager.exe")
WinWaitActive("FalNET G19 Display Manager", "")
WinSetState("FalNET G19 Display Manager", "",@SW_MINIMIZE)
run($PF &"TeamSpeak 3 Clientts3client_win64.exe")
WinWaitActive("TeamSpeak 3", "")
Send("^s")
WinWaitActive("Connect", "")
send("{enter}")
$times2 = 1
EndFunc
func close_teamspeak()
$text = "closing Team Speak"
$p1 = ProcessExists("ts3client_win64.exe")
$p2 = ProcessExists("FalNET G19 Display Manager.exe")
if $p1 = 0 Then
$text = "no Team Speak running"
Else
ProcessClose("ts3client_win64.exe")
;WinSetState("TeamSpeak3", " ",@sw_show)

EndIf
if $p2 = 0 then
Else
ProcessClose("FalNET G19 Display Manager.exe")
EndIf
$times2 = 1
EndFunc
func get_date()
$year = @YEAR
$month1 =@MON
$day1 = @MDAY
$day2 = @WDAY
; converting day number to the name of that day
Select
Case $day2 = 1
$day3 = "Sunday"
Case $day2 = 2
$day3 = "monday"
case $day2 = 3
$day3 = "Tuesday"
case $day2 = 4
$day3 = "wensday"
Case $day2 = 5
$day3 = "Thursday"
Case $day2 = 6
$day3 = "Friday"
case $day2 = 7
$day3 = "Saturday"
EndSelect
;converting number of month to name of that month
Select
Case $month1 = 01
$month2 = "January"
Case $month1 = 02
$month2 = "February"
Case $month1 = 03
$month2 = "March"
Case $month1 = 04
$month2 = "April"
Case $month1 = 05
$month2 = "May"
Case $month1 = 06
$month2 = "June"
Case $month1 = 07
$month2 = "July"
Case $month1 = 08
$month2 = "August"
Case $month1 = 09
$month2 = "September"
Case $month1 = 10
$month2 = "October"
Case $month1 = 11
$month2 = "November"
Case $month1 = 12
$month2 = "December"
EndSelect
$text = "The date is: " & $day3 & " "& $day1 & " of " & $month2 & " " & $year
$times2 = 1
EndFunc
; the Lights functions will grow when i figured out how to
; combine this programm with my lighting scheme
func Lights_on_all()
$text = " Turning all lights on"
EndFunc
func Lights_off_all()
$text = " turning all lights off"
EndFunc

used a Virtual Machine with XP pro to test the speech recognition, this because my version of win7 ultimate is Dutch and does not support speech recognition.

can some one verrify that this also works on Win7?

if so please leave me a PM.

oh and let me know what you guys think of it ;)

Edit: iv'e added the source file

speech.au3

So is the $string = "Sir?" the word to start listening???
Link to comment
Share on other sites

  • 1 year later...

I would avoid "shutdown" commands... My wife enjoyed the idea of being able to run in every half-hour and yell "Shutdown!" and leave laughing hysterically, knowing the evil she had done... ph34r.gif

Not to mention, a false positive would suck... laugh.gif

:)))))))))) 4 years later and here I am, lol-ing like a ************

Link to comment
Share on other sites

@pauleffect

Can you please stop necro posting threads for such inane comments? This is like the 4th one I've come across today from you, and you've only made 7 posts in total, that has got to be a record.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

sorry dude, i'm new to autoit, reading the forum and well.... i didn't see the harm in it. i'll keep it in mind though. 

still, insane is a strong word, don't you think?

____

edit: thanks for the color chooser. i was actually just thinking about that and there it was, in your sig. Perfect! Thanks again!

edit2: באָבקעס מיט קודוצ׳ה does this really mean shivering shit balls?!

Edited by pauleffect
Link to comment
Share on other sites

I said inane.

EDIT: Yes, that's what that translates to.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...