How can I convert text to speech (mp3 file) in python?
audio, mp3, python, text-to-speech
Solution
I do not know about pyttsx, but a while ago I used the Google TTS API to generate MP3s from text.
You can get an idea of how it works from this code snippet. The free version of Google TTS is limited to a certain number of letters for each request, So I'd recommend splitting the text into sentences and creating a file for each sentence.
If you need help with that, please tell me.
Problem
I can convert text to speech in python using puttsx. and I can do record audio using microphone(headphone) to mp3 file. What I want to do is to convert text to mp3 file. Is there a way to store audio playing using pyttsx to memory or unicode string. Can anyone help me storing audio to memory, or how I can convert that string to mp3 file.