2

I am running a Python 2.7 app on Google App Engine and would like to convert text to speech, preferably storing mp3/mp4/wav files in GAE itself. The Python libraries I have seen all have C dependencies and so cannot be deployed on Google App Engine.

Google Translate will do the job online but only for up to 100 characters, and I cannot find any pure Python libraries for merging sound files (my texts are typically much longer than that).

Is there a library or an online service that will allow my app to serve sound files created from texts. For now, I only need English TTS.

0

MaryTTS is a Java text to speech engine so you should be able to run it on GAE or other such services.

This python example shows how to request it (running as a separate service on the same machine) to process some text and return via download a .wav file. You should be able to have it running in one instance and your python code accessing it from another.

0

There are many options, here's how to save a spoken hello world using different libraries:

  • Using gTTS, Google's text-to-speech lib:

    import gtts
    tts = tts.gTTS('hello world', lang='en')
    tts.save('hello-world.mp3')
    tts.save('hello-world.wav')
    
  • Using a Sapi wrapper:

    import tts.sapi
    voice = tts.sapi.Sapi()
    voice.say("Hello")
    voice.set_voice("Anna")
    voice.create_recording('output.wav', "This will be in a wav file")
    
  • pyTTSx allows for TTS, but support for saving output as a file is yet to be developped

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.