hello, how to change the language in the python script " inmoov2 " and myrobotlab to talk inmoov in french please ?
 

beetlejuice

9 years 1 month ago

Hi,

You will have to edit the file "inmoov2" . Translate all the "ear.command" like this :

ear.addCommand("search humans", "python", "trackHumans")

ear.addCommand("quit search", "python", "stopTracking")

must be :

ear.addCommand("cherche humain", "python", "trackHumans")

ear.addCommand("stoppe la recherche", "python", "stopTracking")

Be carrefull, change only the first word .

You have also to translate the aswers of inmoov . Look the section that begin by " DEF " . By exemple :

def playsong():
     data = msg_i01_ear_recognized.data[0]
     if (data == "can i have your attention"):
     i01.mouth.speak("ok you have my attention")
     stopit()
     i01.mouth.speak("electro funk inmoov")
     i01.setHeadSpeed(1.0,1.0)

Will become :

def playsong():
     data = msg_i01_ear_recognized.data[0]
     if (data == "puis-je avoir votre attention"):
     i01.mouth.speak("ok vous avez toute mon attention")
     stopit()
     i01.mouth.speak("electro funk inmoov")
     i01.setHeadSpeed(1.0,1.0)

You must also change the voice to French . Look for this part near the begining of the file :

# starting parts
i01.startMouthControl(leftPort)
i01.startMouth()
#to tweak the default voice
i01.mouth.setGoogleURI("http://thehackettfamily.org/Voice_api/api2.php?voice=Ryan&txt=")

And change it like this :

# starting parts
i01.startMouthControl(leftPort)
i01.startMouth()
#to tweak the default voice

#i01.mouth.setGoogleURI("http://thehackettfamily.org/Voice_api/api2.php?voice=Ryan&txt=")

i01.mouth.setLanguage("fr")

 

I hope this will help you and i didn't made a mistake ( the morning my brain sleep lol ! )

 

Hello and thank you for the answers but it does not work: /
 
Here are the minimum inmoov2 code I modified
 
#file : InMoov2.minimal.py
 
# this will run with versions of MRL above 1695
# a very minimal script for InMoov
# although this script is very short you can still
# do voice control of a right hand or finger box
# for any command which you say - you will be required to say a confirmation
# e.g. you say -> open hand, InMoov will ask -> "Did you say open hand?", you will need to
# respond with a confirmation ("yes","correct","yeah","ya")
 
rightPort = "/dev/usbmodemfa1321"
 
i01 = Runtime.createAndStart("i01", "InMoov")
# starting parts
i01.startEar()
i01.startMouth()
#to tweak the default voice
i01.mouth.setLanguage("fr")
##############
i01.startRightHand(rightPort)
# tweaking defaults settings of right hand
#i01.rightHand.thumb.setMinMax(55,135)
#i01.rightHand.index.setMinMax(0,160)
#i01.rightHand.majeure.setMinMax(0,140)
#i01.rightHand.ringFinger.setMinMax(48,145)
#i01.rightHand.pinky.setMinMax(45,146)
#i01.rightHand.thumb.map(0,180,55,135)
#i01.rightHand.index.map(0,180,0,160)
#i01.rightHand.majeure.map(0,180,0,140)
#i01.rightHand.ringFinger.map(0,180,48,145)
#i01.rightHand.pinky.map(0,180,45,146)
#################
 
# verbal commands
ear = i01.ear
 
ear.addCommand("connecte la main droite", "i01.rightHand", "attach")
ear.addCommand("deconnecte la main droite", "i01.rightHand", "detach")
ear.addCommand("attend", i01.getName(), "rest")
ear.addCommand("ouvre la main", "python", "handopen")
ear.addCommand("ferme la main", "python", "handclose")
ear.addCommand("capture le mouvement", ear.getName(), "captureGesture")
ear.addCommand("manuel", ear.getName(), "lockOutAllGrammarExcept", "voice control")
ear.addCommand("controle de la voix", ear.getName(), "clearLock")
 
ear.addComfirmations("oui","correct","ok","yes")
ear.addNegations("non","faux","nul","nah")
 
ear.startListening()
 
def handopen():
  i01.moveHand("left",0,0,0,0,0)
  i01.moveHand("right",0,0,0,0,0)
 
def handclose():
  i01.moveHand("left",180,180,180,180,180)
  i01.moveHand("right",180,180,180,180,180)

French translation is sometimes English and sometimes all sentences are not recognized, I forget something?

(sorry for my bad english and live google translation :))

Send a noWorky

myrobotlab.org/content/helpful-myrobotlab-tips-and-tricks-0#noWorky 

Your English is fine.. my Fresh is affreux :)

Stephane

9 years 1 month ago

In reply to by GroG

sorry, here is done.
 
I do not understand why the translation French / English and why all my words are not recognized.
 
Also the lady hears voices xD she believes she heard something but no.
 
Translation gives something in this style: "D / I / D / A / SAY /  ATTEND" oO
 
Thank you for your help :)

Hi stephane. I have the same problem (but with spanish). I think that IT doesnt work because when you use for example i01.mouth.setLanguage("fr") you are setting the speaking language not the recognition language. MRL uses sphinx to do voice recognition but this library needs a gramma and a dictionary file to work. As i have seen with MRL only comes the files in english so the recognition doesnt work in another language.

So my question is, how to change the gramma and dictionary files in order to sphinx in MRL can recognise other languages?

Greg do you know how to do it?

Thanks!