It converts text written using IBM's speech synthesis function into natural speech. Same as Polly in AWS.
It's hard to get Pepper to speak nicely. Moreover, it is more difficult to adjust the pronunciation because it cannot be done without the actual machine. I wish I could check it with a virtual robot, but that's not the case. .. What are you guys doing with this? ?? Are they all struggling? ??
So, convert the text to an audio file using Text to Speech and download it. I tried to make it speak as it is.
If you press "Display Credentials" in the action, the username and password will be displayed, so use this.
pepper-python script example
url = "https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?accept=audio/wav&voice=ja-JP_EmiVoice"
param = {"output" : "hello_world.wav", "text" : message}
filePath = self.appFolder + "/" + self.getParameter("file name")
r = requests.get(url, auth=("{username}", "{password}"), params=param)
outfile = open(filePath, 'wb')
outfile.write(r.content)
outfile.close()
I'm using the python requests module for http get. This area will be helpful. http://qiita.com/n0bisuke/items/5b782bb758ce5611cc90
In param, the output (download) file name and the text of the conversion source are set. In requests.get, set the above credentials and param and issue a request
It will be saved as ʻoutfile.write (r.content)in the location that was set to
filePath` in Pepper.
Then play it in the Play Sound box and you're done.
Recommended Posts