Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Enable voice control wherever a textbox/OSK exists? HOW??

  1. #11
    FLAC
    Auto Apps:loading...
    EL CAMINO's Avatar
    Join Date
    Jul 2005
    Location
    upland california us
    Posts
    1,283
    @Profit
    sorry man, all i know is a little bit of Autoit, i'm lost in Vb.net, but i see you have it working by now, hope to see that secret program soon.

    @iceman
    i need to play more with voice control, my end gives me errors when enabled, cut be my end(nlite) so yea i can help you out with this, but if you know the commands let me know and we can get it to work for sure.

  2. #12
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    Just gotta find the rr.execute() commands needed for:

    a) Pausing Audio - $rr.Execute("Pause")
    b) Switching the voice control .xml file to the mini version (optional) - ?
    c) Sending the HOTKEY to RR/Voicecontrol application - ? Cant seem to get $rr.Execute("SENDKEY;{F10}") to work
    (turning the Mic on)
    d) Sending the ENTER key to RR's OSK/TextBox - $rr.Execute("Enter")
    (submitting the text to RR and turning the mic off)

    ....If I use $rr.Execute("Enter") inside the playlist search in BMV2 it works nicely, howver if I use it inside CDRIP to name the Artist/Album/etc, $rr.Execute("Enter") takes me to the main menu.
    Is there any other way to trigger the enter command?

    f) Resume audio - $rr.Execute("Resume")

  3. #13
    FLAC
    Auto Apps:loading...
    EL CAMINO's Avatar
    Join Date
    Jul 2005
    Location
    upland california us
    Posts
    1,283
    a)done i guess.
    b)well dont know how voice uses this xml, but if is just mater of changing the file, file move would work nicely.
    c)
    Code:
    $Voice = WinGetHandle("RoadRunner", "")
    WinActivate($Voice, "")
    Send("{F10}")
    d)dont know about this one.
    e)??
    f)what about if music is paused before all this process? if you use resume or play will start playing no matter what, when finish, maybe use
    Code:
     $Status = $rr.getinfo("STATUS")
    to poll the status info, and according to that, resume or not after this process.

  4. #14
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    Oops.. there was no (e) . I'm a little overzealous to get this working I guess
    Good thinking regarding the status polling. Fixed it now.

    Ive figured (d) out. When you click the text cursor (for 0.8 seconds in the text field) to trigger the Voice recognition to turn on, the process of sending the F10 key is actually taking focus away from the RR CDRIP app. This causes the LOADING screen to be seen. Pressing ESC goes back to the main menu and the entire app is still running correctly (thinking that it has been told to stop voice recognition etc).

    Test: I replaced the send F10 to RR with send "5" to Calculator, the app worked perfectly and CDRIP DID NOT lose focus from the OSK screen.

    [All testing was done on BMV2.]

    Any other ways to trigger the Voice recognition plugin to ON?
    Can the plugin be recoded to include this option?
    I would almost prefer it if the plugin wasnt waiting for a hotkey, purely turning the Mic input ON/OFF.

    I tried the following commands to send the F10 key - all result in LOADING screen:

    1. ControlSend("RoadRunner","","","{F10}")

    2. $Voice = WinGetHandle("RoadRunner", "")
    WinActivate($Voice, "")
    Send("{F10}")

    Anyway, heres my current code:
    Code:
    #Include <Misc.au3>
    AutoItSetOption("WinTitleMatchMode", 3)
    $test = "test"
    $SpeechOn = -1
    $PlayStatus = -1
    If WinExists($test) Then Exit 
    AutoItWinSetTitle($test)
    
    $rr=ObjCreate("RoadRunner.sdk")
    if not IsObj($rr) then Exit
    $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
    
    HotKeySet("!{esc}", "_exit") ;for testing only, exit ALT+ESC disable when no need for it.
    
    While 1
    	If  $oMyError.windescription then 
    		if Not WinExists("RoadRunner") then ExitLoop ;exit if RR is not Running.
    	EndIf
    	
    	If MouseGetCursor() = 5 And _IsPressed("01") then
    		;Mouse has been clicked where the User wants to dictate
    		If ($rr.getinfo("STATUS") = "Play") Then	;Check the previous play/pause/stop status
    			$rr.Execute("pause") ;Pause music		;if playing, then pause the music, else skip
    			$PlayStatus = 1
    		EndIf
    		
    		;ControlSend("RoadRunner","","","{F10}") ; this does the same as the 3 code lines below - but is slightly less obtrusive
    		;the above line tries to tell the Voice Recog plugin to start accepting dictation
    		
    		$Voice = WinGetHandle("RoadRunner", "") ;trigger hotkey line 1
    		WinActivate($Voice, "");trigger hotkey line 2
    		Send("{F10}");trigger hotkey line 3
    		
    		$SpeechOn= 1 ; Tells the app that it is about to receive speech commands
    	EndIf
    	
    Sleep (800)                ;push and hold for 0.8 seconds to engage Voice control
    	
    
    	While (MouseGetCursor() = 5 And $SpeechOn = 1) Or (Not(_IsPressed("01")) And Not(MouseGetCursor() = 5) And $SpeechOn = 1)  
    		;Above line checks that EITHER:
    		;a)The cursor is a text cursor (Ibeam) and it doesnt care if its being left clicked; or
    		;b) The cursor is NOT a text cursor (Ibeam) but thats OK, as long as the user isnt left clicking on anything - purely moving the mouse around!
    		
    		; While we are waiting for the speech input, we make sure that the cursor stays as a TEXT CURSOR and is in speech mode
    		; Just sit here and do nothing. This means the app will wait till the 
    		; ..user finishes talking and issues their "ENTER" command
    		
    	WEnd
    	
    	If Not(MouseGetCursor() = 5) And $SpeechOn = 1 Then ;As soon as the user gives the ENTER command - This needs work!
    		;Place code here for
    		;turn mic off /hotkey - mic has auto-off it seems
    		$rr.Execute("ENTER") ;press enter/submit text - doesnt always work
    		If ($rr.getinfo("STATUS") = "PAUSE") AND ($PlayStatus = 1) Then ;at the top we checked if RR was playing/paused/stopped, if playing this resumes, else skips over
    		$rr.Execute("resume") ;resume audio
    		$PlayStatus = -1
    		EndIf
    	
    		$SpeechOn = 0 ; Turn off voice commanding - ignore incoming commands/turn mic off
    		
    	EndIf
    	
    			
    WEnd
    ;==============================================================================================
    ;AI's error reporting Object
    ;==============================================================================================
    
    Func MyErrFunc()
        Local $err = $oMyError.number
        If $err = 0 Then $err = -1
        SetError($err) 
    Endfunc
    
    Func _exit()
    Exit
    EndFunc

    EDIT: changed code to use the '$voice' method (simply changed commenting), as method 1 didnt always work (ControlSend("RoadRunner","","","{F10}"))


    Ice

  5. #15
    Newbie
    Join Date
    Jul 2006
    Posts
    35

    Voice Dictation

    @ICE

    Any other ways to trigger the Voice recognition plugin to ON?
    Can the plugin be recoded to include this option?
    I would almost prefer it if the plugin wasnt waiting for a hotkey, purely turning the Mic input ON/OFF.

    I agree with turning the mic on/off. I had to switch to using the hotkey because the mic was always on and the voice control was in listen mode. I noticed that outside noise or conversation that may have resembled commands would get executed.

    When I left work last night I tested what I was talking about. In order to type letters using the current voice commands the system had to be prompted for every letter - press a button letter "a" press a button letter "b" and so on. IMO the voice command system needs to be more like a Dragon Dictate software or the Microsoft voice dictation. Then the system could disseminate entire words or phrases. This would also facilitate the use of playing artists, or albums on command. I know there is a plugin (SmartPlaylist) that does this but if the voice commands plugin can be "re-written" may want to consider that as well.

  6. #16
    FLAC
    Auto Apps:loading...
    EL CAMINO's Avatar
    Join Date
    Jul 2005
    Location
    upland california us
    Posts
    1,283
    Quote Originally Posted by montgomeryt View Post
    @ICE

    the system had to be prompted for every letter - press a button letter "a" press a button letter "b" and so on. IMO the voice command system needs to be more like a Dragon Dictate software or the Microsoft voice dictation. Then the system could disseminate entire words or phrases. This would also facilitate the use of playing artists, or albums on command. I know there is a plugin (SmartPlaylist) that does this but if the voice commands plugin can be "re-written" may want to consider that as well.
    thats not good, i didnt know that.

  7. #17
    Newbie
    Join Date
    Jul 2006
    Posts
    35
    Since one of the requirements of Voice control is have the SAPI 5 SDK installed why can't this be utilized to extend the voice commands but not limit it to what it's in the commands.cfg ?

  8. #18
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    Quote Originally Posted by montgomeryt View Post
    Since one of the requirements of Voice control is have the SAPI 5 SDK installed why can't this be utilized to extend the voice commands but not limit it to what it's in the commands.cfg ?
    Im starting to get the hang of the grammar compiler, but I prefer the one in Powervoice. Its more visual, and almost menu driven. Easy/Fun to use

    Quote Originally Posted by montgomeryt View Post
    @ICE
    When I left work last night I tested what I was talking about. In order to type letters using the current voice commands the system had to be prompted for every letter - press a button letter "a" press a button letter "b" and so on.
    I tried this myself with this script, however I was able to issue unlimited phonetic characters in sequence without any trouble. If you use letters, you must say "letter a, letter b, etc" becuase of how the grammar file is constructed. the phonetics are top level and can be called purely by saying the word (alpha, bravo,etc), whereas the letters must be invoked with the "letter" prefix. Try using my settings.xml. I did NOT have to press any button between each word either. Spoke the word Techno (Tango, Alpha, Charlie, Hotel Kilo) with a slight pause between each word. Worked perfect

    IE: Click mouse for 1 second, Say "Tango.. Echo.. Charlie.. Hotel.. November.. Oscar, (TECHNO) then click mouse outside of textcursor area to simulate the ENTER command.



    Reading Guino's first post (the 2nd post of this thread), it might infact be easier to write this as a plugin which talks direct to the voice control (which is embedded in RR).
    I only mention this because of the issue of sending the Hotkey (F10) which makes the app lose focus.


    Ive re-written a commands.xml - basically stripped out everything except for Phonetics, numbers 0-10, and some editing commands. Pretty simple once you get the idea. I wanted it as simple as possible to eliminate any false positives.

    Code:
    <GRAMMAR LANGID="409">
    
      <DEFINE>
        <ID NAME="RID_StopReco" VAL="-1"/>
        <ID NAME="RID_RR" VAL="1"/>
      </DEFINE>
    
    
      <RULE NAME="sendKeys" TOPLEVEL="ACTIVE">
        <L PROPNAME="sendkeysvalue">
          <P VALSTR="general">
           <L PROPNAME="generalkeyvalue">
             <P VALSTR="{ENTER}">enter</P>
             <P VALSTR="{ENTER}">okay</P>
             <P VALSTR="%(y)">confirm yes</P>
             <P VALSTR="%(n)">confirm no</P>
             <P VALSTR="{ESC}">escape</P>
             <P VALSTR="a">+alpha</P>
             <P VALSTR="b">+bravo</P>
             <P VALSTR="c">+charlie</P>
             <P VALSTR="d">+delta</P>
             <P VALSTR="e">+echo</P>
             <P VALSTR="f">+foxtrot</P>
             <P VALSTR="g">+golf</P>
             <P VALSTR="h">+hotel</P>
             <P VALSTR="i">+india</P>
             <P VALSTR="j">+juliet</P>
             <P VALSTR="k">+kilo</P>
             <P VALSTR="l">+lima</P>
             <P VALSTR="m">+mike</P>
             <P VALSTR="n">+november</P>
             <P VALSTR="o">+oscar</P>
             <P VALSTR="p">+papa</P>
             <P VALSTR="q">+quebec</P>
             <P VALSTR="r">+romeo</P>
             <P VALSTR="s">+sierra</P>
             <P VALSTR="t">+tango</P>
             <P VALSTR="u">+uniform</P>
             <P VALSTR="v">+victor</P>
             <P VALSTR="w">+whiskey</P>
             <P VALSTR="x">+xray</P>
             <P VALSTR="y">+yankee</P>
             <P VALSTR="z">+zulu</P>
             <P VALSTR=".">dot</P>
             <P VALSTR=".">period</P>
             <P VALSTR="%">percent</P>
             <P VALSTR="/">forward slash</P>
             <P VALSTR="\">back slash</P>
             <P VALSTR="@">at sign</P>
             <P VALSTR="{Caplock}">Switch Case</P> 
    <!--Above doesnt work. Need to find command to cycle Caps ON/OFF-->
    
             <P VALSTR="{END}{SHIFTDOWN}{HOME}{SHIFTUP}{BACKSPACE}">clear that</P> 
    <!-- Above doesnt work. Need to find command to HOLD shift down while pressing home, as CTRL+A doesnt work in RR text fields-->
    
            </L>
          </P>
          <P VALSTR="edit">
            <P>edit</P>
            <L PROPNAME="editkeyvalue">
              <P VALSTR="{UP}">Up</P>
              <P VALSTR="{DOWN}">Down</P>
              <P VALSTR="{LEFT}">Left</P>
              <P VALSTR="{RIGHT}">Right</P>
              <P VALSTR="{PGDN}">page down</P>
              <P VALSTR="{PGUP}">page up</P>
              <P VALSTR="{TAB}">Tab</P>
              <P VALSTR="{BACKSPACE}">Backspace</P>
              <P VALSTR="{DELETE}">delete</P>
              <P VALSTR="{ENTER}">new line</P>
              <P VALSTR="^(a)">selectall</P>
              <P VALSTR="^(a){BACKSPACE}">clearall</P>
              <P VALSTR="^(z)">undo</P>
              <P VALSTR="^(c)">copy</P>
              <P VALSTR="^(v)">paste</P>
            </L>
          </P>
        </L>
        </RULE>
    
    
      <RULE NAME="NumsendKeys" TOPLEVEL="ACTIVE">
           <L PROPNAME="numberskeyvalue">
              <P VALSTR="1">one</P>
              <P VALSTR="2">two</P>
              <P VALSTR="3">three</P>
              <P VALSTR="4">four</P>
              <P VALSTR="5">five</P>
              <P VALSTR="6">six</P>
              <P VALSTR="7">seven</P>
              <P VALSTR="8">eight</P>
              <P VALSTR="9">nine</P>
              <P VALSTR="0">zero</P>
              <P VALSTR="`0">ten</P>
            </L>
      </RULE>
    
    </GRAMMAR>
    With the first part of Voice.ini as follows
    Code:
    [Program]
    KeyWord=computer
    RepeatCommand=False
    ReplyOnKeyword=False
    AlwaysOnTop=True
    ShowDetails=True
    UseKeyword=False
    useHotKey=True
    Hotkey_Keyword=VK_F10
    KeywordTimeout=0
    PauseTimeout=0
    MinimizeOnStart=False
    PositionTop=11550
    PositionLeft=2520
    BeepFreq=600
    BeepDuration=10
    allowMediaCmds=false
    DictateMode=False
    ReadWindowsMsgs=False
    Important:
    If you trigger the voice app by pressing F10 it goes into 'Listening for Command' mode (which is what we want, not "listening for KEYWORD"). When you press the 'Mic On' button, it turns off the recognition and displays "Not Listening'. As long as you restimulate it using F10 (and not pressing Mic ON) it wil go back to 'Listening for Command' and not "Listening for keyword". This means its always ready for input. Not waiting for "Computer". I also set my timeouts to 0, so it never reverts to "listening for keyword".

    I would prefer however, if we could make an alternate hotkey, one that simply turned the mic on/off and left it in "Ready for command" mode always!

    I just realised that the source for voice recognition is integrated into RR, which would meant that Guino can modify it if needed. Perhaps we can look at this from another angle, and have the voice prog/RR modded slightly to accomodate our needs. Perhaps something like being able to control a $rr.voice=on after doing the necessary '...roadrunner.sdk' declarations?? Would be better than sending keys...Thoughts?

    Ice

  9. #19
    Newbie
    Join Date
    Jul 2006
    Posts
    35
    Quote Originally Posted by Iceman_jkh View Post

    I tried this myself with this script, however I was able to issue unlimited phonetic characters in sequence without any trouble. If you use letters, you must say "letter a, letter b, etc" becuase of how the grammar file is constructed. the phonetics are top level and can be called purely by saying the word (alpha, bravo,etc), whereas the letters must be invoked with the "letter" prefix. Try using my settings.xml. I did NOT have to press any button between each word either. Spoke the word Techno (Tango, Alpha, Charlie, Hotel Kilo) with a slight pause between each word. Worked perfect

    IE: Click mouse for 1 second, Say "Tango.. Echo.. Charlie.. Hotel.. November.. Oscar, (TECHNO) then click mouse outside of textcursor area to simulate the ENTER command.
    I saw those but I wasn't sure what their purpose was and since I'm not real familiar with XML I just didn't understand them.

    Quote Originally Posted by Iceman_jkh View Post
    Important:
    If you trigger the voice app by pressing F10 it goes into 'Listening for Command' mode (which is what we want, not "listening for KEYWORD"). When you press the 'Mic On' button, it turns off the recognition and displays "Not Listening'. As long as you restimulate it using F10 (and not pressing Mic ON) it wil go back to 'Listening for Command' and not "Listening for keyword". This means its always ready for input. Not waiting for "Computer". I also set my timeouts to 0, so it never reverts to "listening for keyword".

    I would prefer however, if we could make an alternate hotkey, one that simply turned the mic on/off and left it in "Ready for command" mode always!

    I just realised that the source for voice recognition is integrated into RR, which would meant that Guino can modify it if needed. Perhaps we can look at this from another angle, and have the voice prog/RR modded slightly to accomodate our needs. Perhaps something like being able to control a $rr.voice=on after doing the necessary '...roadrunner.sdk' declarations?? Would be better than sending keys...Thoughts?

    Ice
    You're programming skills are WAY more advanced then mine are. I was lucky to get autohotkey program to mute the line in, send the f10 key and then sleep long enough to accept the commands then unmute and go on it's way. So I to your skill !

  10. #20
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    Neither was I mate. Just tried editing and recompiling 1 step at a time. Eventually I had cut it down to what I wanted

    Well, honestly I just started at this. El Camino is way more advanced than me.. so I to him

    Have you tried my script? Or are you using your own one?

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. voice control sw
    By TwinII in forum Software & Software Development
    Replies: 31
    Last Post: 08-18-2002, 05:15 AM
  2. voice control idea
    By crazyshaxs in forum Software & Software Development
    Replies: 4
    Last Post: 02-25-2002, 01:32 AM
  3. Replies: 22
    Last Post: 08-13-2001, 02:42 PM
  4. Voice Control
    By bjrady in forum Software & Software Development
    Replies: 4
    Last Post: 05-26-2001, 04:45 AM
  5. Voice Control for Winamp
    By Stryph in forum Software & Software Development
    Replies: 8
    Last Post: 09-15-2000, 12:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •