Leo Liu commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def text2story(text):
|
|
| 26 |
|
| 27 |
# text2audio
|
| 28 |
def text2audio(story_text):
|
| 29 |
-
tts = gTTS(text = story_text, lang='en')
|
| 30 |
audio_bytes = io.BytesIO()
|
| 31 |
tts.write_to_fp(audio_bytes)
|
| 32 |
audio_bytes.seek(0)
|
|
|
|
| 26 |
|
| 27 |
# text2audio
|
| 28 |
def text2audio(story_text):
|
| 29 |
+
tts = gTTS(text = story_text, lang='en') # gtts is for a female voice which is more suitable for reading the story for children
|
| 30 |
audio_bytes = io.BytesIO()
|
| 31 |
tts.write_to_fp(audio_bytes)
|
| 32 |
audio_bytes.seek(0)
|