Page 1 of 3 123 LastLast
Results 1 to 10 of 28

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

  1. #1
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597

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

    Does anyone know how I can enable Voice Control whenever the OSK/text Cursor appears?

    I dont want to control RR with it, only enter text and have it auto trigger whever there is an opportunity to type.

    EG:
    Enter address in Satnav
    Enter track title in music search
    Fill in Album/Artist/Genre in CdRip plugin
    Enter a phone number in Phoco/Freefone/RRmobile

    Is there an elegant/correct way to have this occur? something like trapping every call to OSK, or detecting wherever there is a text cursor/input field on the screen?
    Any other ideas?

    Thanks
    Ice

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    Only by a means of a plugin you'd be able to check if RR is in either NUMOSK.SKIN or OSK.SKIN and have the voice control activated... I'd suppose you could also have a timer in NUMOSK.SKIN and OSK.SKIN which executes a command to activate the voice, and then have another command in the ESC/ENTER buttons of the OSK so it disables the voice control.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  3. #3
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    Is there any way to detect if the pointer has become a text cursor ?
    and doing it that way?

  4. #4
    FLAC
    Auto Apps:loading...
    EL CAMINO's Avatar
    Join Date
    Jul 2005
    Location
    upland california us
    Posts
    1,283
    try this. simple very simple script.

    Code:
    #Include <Misc.au3>
    AutoItSetOption("WinTitleMatchMode", 3)
    $test = "test"
    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
          MsgBox(4096, "", " text mode")
           $rr.execute("YOUR_COMMAND") ;place here your command
    	EndIf
    Sleep (3000)                ;push and hold 3 sec for executing.
    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

  5. #5
    Maximum Bitrate pRoFiT's Avatar
    Join Date
    Apr 2005
    Location
    Fresno, CA
    Posts
    795
    Perfect thread.....Subscribed to thread

    El Camino, do you have the same code for vb.net

    I think i can create the roadrunner.sdk object like this
    Code:
    Dim rr As Object = CreateObject("RoadRunner.sdk")
    hmm, strange but neat at the same time. If i do that roadrunner starts. so what..., i would be compiling a new program that would include RR? Or a new program that would include my features but call/open RR?

    Okay tested a little more. So That will give me access to send to RR? And if my program is run without rr running, then rr will start. Otherwise RoadRunner can LOAD my program while entering a skin that would need my programs enteraction. Then you can have the skin close my program on exit.....hmmm.

    Iceman_jkh, I would love to see what you end up with. I have a program that i'm secretly working on that needs the same kind of control of RR.
    Um, I guess this is where you put something witty.WITTY

    My Web site, in the design stage. http://home.comcast.net/~cstrachn

    Modified RRSkinEditor http://www.mp3car.com/vbulletin/rr-skins/65723-rrskineditor-bugs-fixes-comments-current-progress-outdated.html

  6. #6
    Maximum Bitrate pRoFiT's Avatar
    Join Date
    Apr 2005
    Location
    Fresno, CA
    Posts
    795
    Hope the forum lets me double post
    Anyways after a couple seconds i can send searchs to the search box like this.
    Created a new form with button1 and textbox1

    Code:
    Public Class Form1
    
        Dim rr As Object = CreateObject("RoadRunner.sdk")
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim i As Integer
            Dim ch As String ' must be string to send :)
            For i = 0 To TextBox1.Text.Length - 1
                ch = TextBox1.Text.Chars(i)
                rr.execute(ch)
            Next i
            rr.execute("Enter")
        End Sub
    End Class
    Simple VB.net code
    Um, I guess this is where you put something witty.WITTY

    My Web site, in the design stage. http://home.comcast.net/~cstrachn

    Modified RRSkinEditor http://www.mp3car.com/vbulletin/showthread.php?t=65723

  7. #7
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    Thanks El Camino.

    EDIT: I got it to compile - turns out it must be saved as a .au3 file before it allows compilation (DOH!)

    Basically, if the cursor becomes a text cursor, I want:
    a) Audio to mute/pause
    b) Mic to turn on
    c) Accept commands/phonetic alphabet...until;
    d) ENTER/command word is said (which is the equivalent of pressing ENTER)
    e) turn mic off - as ENTER should change the cursor back to a pointer (not text cursor).
    f) Audio resumes/unmutes

    Profit> would also love to see what you are working on (in secret :P)

    I'm hoping this little 'plugin' will make the voice control actually viable and useful!

    Cheers
    Ice

  8. #8
    Newbie
    Join Date
    Jul 2006
    Posts
    35

    Question ICE

    Quote Originally Posted by Iceman_jkh View Post
    Thanks El Camino.

    Can you step me through that script a little. I ve only written 1 very VERY basic script before. I couldnt even see how to get this to compile.

    EDIT: I got it to compile - turns out it must be saved as a .au3 file before it allows compilation (DOH!)

    Basically, if the cursor becomes a text cursor, I want:
    a) Audio to mute/pause
    b) Mic to turn on
    c) Accept commands/phonetic alphabet...until;
    d) ENTER/command word is said (which is the equivalent of pressing ENTER)
    e) turn mic off - as ENTER should change the cursor back to a pointer (not text cursor).
    f) Audio resumes/unmutes

    Profit> would also love to see what you are working on (in secret :P)

    I'm hoping this little 'plugin' will make the voice control actually viable and useful!

    Cheers
    Ice
    Ice - Won't you still have to issue the "letters" command or "numbers" command since they are in the commands.cfg or could you load a different config file for just the osk ? Also, doesn't the voice module stop listening after a successful command is issued and you have to prompt again ? I know I'm asking more questions than I'm helping but wanted to think it all the way through.

    I use the voice control in mine all the time but I have a steering wheel control mapped to enable the voice prompt and then mute the mic after a set amount of time. Works out pretty well - I don't normally issue just letter and number commands because of what I asked you above.

  9. #9
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    OK, now that I can run it , Ive managed to understand whats going on

    Heres what ive put together.
    Purely a concept at the moment. Credit goes to El Camino for the main code!

    Code:
    #Include <Misc.au3>
    AutoItSetOption("WinTitleMatchMode", 3)
    $test = "test"
    $SpeechOn = -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
    		;Place code here.. to tell Voice control to listen
    	    ;$rr.execute("My_Commands")
    		$rr.execute("next") ;Just a test - so you can see it switch to the next track - delete this line in real version!
    	   $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
    		; 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
    		; Might have to add a trap for AND Not(_IsPressed("0D")) to the end of this While loop
    	WEnd
    	
    	If Not(MouseGetCursor() = 5) And $SpeechOn = 1 Then ;As soon as the user presses ENTER or gives the ENTER command
    	
    		$SpeechOn= 0 ; Turn off voice commanding - ignore incoming commands/turn mic off
    		$rr.execute("prev") ;Just a test - so you can see it switch to the prev track - delete this line in real version!
    		;$rr.execute("My_Commands") any other commands you wish to run
    	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
    Compile it to an autoit script.
    Hold left click for 0.8 seconds on a text box - should skip to next track.
    Pressing enter, moving cursor off text box,etc should skip to prev track.

    Basically all this does is prove that you can recognise such events and then trigger commands as a result
    Next step is getting it to control/interface to the voice commands aspect of RR.

    Ice

  10. #10
    Maximum Bitrate
    Join Date
    Nov 2005
    Posts
    597
    Quote Originally Posted by montgomeryt View Post
    Ice - Won't you still have to issue the "letters" command or "numbers" command since they are in the commands.cfg or could you load a different config file for just the osk ? Also, doesn't the voice module stop listening after a successful command is issued and you have to prompt again ? I know I'm asking more questions than I'm helping but wanted to think it all the way through.

    I use the voice control in mine all the time but I have a steering wheel control mapped to enable the voice prompt and then mute the mic after a set amount of time. Works out pretty well - I don't normally issue just letter and number commands because of what I asked you above.
    Im not that advanced at the voice control prog as you are mate.
    But reading the .xml I can see what you are asking.
    Hopefully we can create a smaller version of the .xml with only letters,numbers,etc using the grammar compiler. To be used specifically for this purpose. Even better would be causing the voice recognition to only use the mini .xml file when triggered in this way... and use the normal grammar file if invoked any other way. Get my drift?

    Could even use PowerVoice from 0l33l (i tihnk it was). All I really want is a prog that writes what I speak into the text box.

Page 1 of 3 123 LastLast

Similar Threads

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

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
  •