Implementing TTS in Android (for self voicing)
Posted: Thu Jul 11, 2019 6:42 pm
I believe I asked about this one before and I'm looking into it again.
What is like to do is make the self voicing function work on Android devices.
In my looking around, I found gTTS
https://pypi.org/project/gTTS/
Which can be used with Python
As I understand it, the text that shows in a say window is not actually text, but an image created from the script. I was wondering how I might get that text into the gTTS module?
I also found iOS TTS
Which can also record speech
And convert it to text (for renpy.input?)
http://omz-software.com/pythonista/docs/ios/speech.html
Anybody got any tips to getting these to work with Ren'Py?
What is like to do is make the self voicing function work on Android devices.
In my looking around, I found gTTS
https://pypi.org/project/gTTS/
Which can be used with Python
Code: Select all
from gtts import GTTS
import os
tts = gTTS(text='Hello world', lang='en')
tts.save("hello.mp3")
os.system("mpg321 hello.mp3")
I also found iOS TTS
Code: Select all
import speech
speech.say('Hola mundo', 'es_ES')
Code: Select all
import sound
r = sound.Recorder('audio.m4a')
r.record(3) # seconds
Code: Select all
text = speech.recognize('audio.m4a', 'en')[0][0] # sent to Apple servers
Anybody got any tips to getting these to work with Ren'Py?