Skip to content

Instantly share code, notes, and snippets.

@ksasao
Last active August 29, 2015 14:13
Show Gist options
  • Save ksasao/81f5af2eaa36652b8d6d to your computer and use it in GitHub Desktop.
Save ksasao/81f5af2eaa36652b8d6d to your computer and use it in GitHub Desktop.
Windowsのコマンドプロンプトから文字列を入力してPepperにしゃべらせるサンプル。Pepper用のPythonライブラリについては http://qiita.com/Atelier-Akihabara/items/3289e60985586b8da709 を参照。License: WTFPL
# -*- coding: utf-8 -*-
from naoqi import ALProxy
animSpeech = ALProxy('ALAnimatedSpeech', "192.168.1.10", 9559)
while 1:
data = raw_input()
p = unicode(data, 'shift-jis').encode('utf-8')
sentence = "\RSPD="+ str( 100 ) + "\ "
sentence += "\VCT="+ str( 120 ) + "\ "
sentence += str(p)
sentence += "\RST\ "
configuration ={"bodyLanguageMode":"contextual"}
animSpeech.post.say(str(sentence), configuration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment