Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Basic speech recognition.


  • Please log in to reply
18 replies to this topic

#1 JRowe

JRowe

    Chasing the white rabbits

  • Active Members
  • PipPipPipPipPipPip
  • 1,765 posts

Posted 01 June 2010 - 07:07 AM

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.


AutoIt         
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, 01 June 2010 - 07:12 AM.

  • Xandy likes this







#2 DJKMan

DJKMan

    Wayfarer

  • Active Members
  • Pip
  • 53 posts

Posted 02 June 2010 - 06:03 AM

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, 02 June 2010 - 06:07 AM.

My work in AutoIt (Not many yet):

Parse Large Text Files To 2D Array Quickly [With Chunk Size]

 

aliceround1.png

My artificial intelligence project coded entirely in AutoIt. Meet Alice Assistant: http://facebook.com/ProjectAliceAI

 


#3 JRowe

JRowe

    Chasing the white rabbits

  • Active Members
  • PipPipPipPipPipPip
  • 1,765 posts

Posted 02 June 2010 - 05:30 PM

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:

#4 Aki

Aki

    Seeker

  • New Members
  • 1 posts

Posted 24 September 2010 - 10:33 AM

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.

#5 BinaryBrother

BinaryBrother

    Resourceful

  • Active Members
  • PipPipPipPipPipPip
  • 800 posts

Posted 17 November 2010 - 11:59 PM

Hypothesis(): Hypothized text is:
this listens to what you say into your microphone runs it through the windows speech recognition engine and outputs the results to console


Woa... This thing works almost perfectly. :graduated:

Awesome example, exactly what I needed.
Meh...

#6 BiliyomKi

BiliyomKi

    Seeker

  • Active Members
  • 36 posts

Posted 20 November 2010 - 06:54 PM

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, 20 November 2010 - 07:13 PM.

An AutoIT user.

#7 Achilles

Achilles

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,897 posts

Posted 21 November 2010 - 07:06 AM

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, 21 November 2010 - 07:09 AM.


#8 BinaryBrother

BinaryBrother

    Resourceful

  • Active Members
  • PipPipPipPipPipPip
  • 800 posts

Posted 21 November 2010 - 07:09 AM

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... Posted Image

Not to mention, a false positive would suck... Posted Image
Meh...

#9 Piyush

Piyush

    Adventurer

  • Active Members
  • PipPip
  • 108 posts

Posted 13 January 2011 - 06:54 AM

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..
Piyush.....Some Of My Scripts...Cool Font Generator Train Searcher and Tracer

#10 Maffe811

Maffe811

    Sir Longbottle

  • Active Members
  • PipPipPipPipPipPip
  • 665 posts

Posted 03 June 2011 - 11:37 AM

...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, 03 June 2011 - 11:47 AM.

Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.Scripts:
Spoiler

#11 vtuls

vtuls

    Seeker

  • Active Members
  • 41 posts

Posted 23 May 2012 - 06:42 PM

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:

AutoIt         
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
Attached File  speech.au3   6.45KB   557 downloads

Edited by vtuls, 23 May 2012 - 07:48 PM.

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

#12 barkeeper

barkeeper

    Seeker

  • Active Members
  • 34 posts

Posted 20 August 2012 - 07:08 AM

it runs on win7 enterprise x64, but I don't get a screen or GUI to input data or speech, do I need to press a key combination ?

#13 Kendall

Kendall

    Seeker

  • Active Members
  • 42 posts

Posted 28 September 2012 - 06:43 AM

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:

AutoIt         
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
Attached File  speech.au3   6.45KB   557 downloads

So is the $string = "Sir?" the word to start listening???

#14 pauleffect

pauleffect

    Seeker

  • Active Members
  • 19 posts

Posted 28 January 2014 - 12:32 PM

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 ************



#15 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,582 posts

Posted 28 January 2014 - 08:23 PM

@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 an XP machine, 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!

 

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

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.


#16 pauleffect

pauleffect

    Seeker

  • Active Members
  • 19 posts

Posted 03 February 2014 - 08:22 PM

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, 03 February 2014 - 08:29 PM.


#17 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,582 posts

Posted 03 February 2014 - 08:28 PM

I said inane.

 

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


Edited by BrewManNH, 03 February 2014 - 08:48 PM.

  • pauleffect likes this

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 an XP machine, 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!

 

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

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.


#18 CybergodSixosix

CybergodSixosix

    Seeker

  • New Members
  • 1 posts

Posted 04 February 2014 - 10:17 PM

sorry to sound like a newbe but what programming or scripting language is this written in?



#19 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 12,990 posts

Posted 04 February 2014 - 11:06 PM

AutoIt


AutoIt Absolute Beginners Require a serial
 
 
OMG! Women are the cows of people.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users