Created
January 22, 2016 01:17
-
-
Save tai-fukaya/25286b24d2c3056e4697 to your computer and use it in GitHub Desktop.
音声ファイルを作成せずに、PepperでC3P0っぽいセリフを言う
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
from naoqi import ALProxy | |
from datetime import datetime | |
if (len(sys.argv) < 2): | |
print "Usage: 'python .py IP [PORT]'" | |
sys.exit(1) | |
IP = sys.argv[1] | |
PORT = 9559 | |
if (len(sys.argv) > 2): | |
PORT = sys.argv[2] | |
try: | |
tts = ALProxy("ALTextToSpeech", IP, PORT) | |
except Exception,e: | |
print "Could not create proxy to ALTextToSpeech" | |
print "Error was: ",e | |
sys.exit(1) | |
tts.setLanguage("Japanese") | |
# C3POのセリフ タブレットに金色のPepperを表示させるとベター | |
tts.setVoice("osamu_n16") | |
tts.say("\\rst\\\\vct=195\\\\rspd=130\\\\vol=200\\ア、アれ、あ有るツん、オイッ、ドコへ行っタ?") | |
# 設定を戻す | |
tts.say("\\rst\\") | |
tts.setVoice("maki_n16") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment