SoftBank Robotics documentation What's new in NAOqi 2.5? [For Partners only]

Using the API - Making NAO speak

Making NAO speak

Try to run the following code:

from naoqi import ALProxy
tts = ALProxy("ALTextToSpeech", "<IP of your robot>", 9559)
tts.say("Hello, world!")

Using a proxy

ALProxy is an object that gives you acces to all the methods or the module your are going to connect to.

class ALProxy(name, ip, port)
  • name - The name of the module
  • ip - The IP of your robot
  • port - The port on which NAOqi listens (9559 by default)

Every method of the module are directly accessible through the object, for instance:

almemory = ALProxy("ALMemory", "nao.local", 9559)
pings = almemory.ping()