How to use espeak with python

I want to use espeak ( http://espeak.sourceforge.net ) with python2.7.0-32 bits in windows7.

In addition, I also want to save the audio files created with espeak.

+4
source share
4 answers

I tried to install this package on Windows 8, but could not get it in the first attempts.

But this is what I did to get espeak to work with python

  • Download and install espeak for Windows from here
  • Add the eSpeak/command-line folder to PATH so that the espeak command is espeak
  • Invoking espeak commands using the python subprocess module, similar to the way in the example below

http://machakux.appspot.com/blog/44003/making_speech_with_python

+5
source

How about something like that.

 import subprocess def execute_unix(inputcommand): p = subprocess.Popen(inputcommand, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() return output a = "Some amazing words of wisdom." # write out to wav file b = 'espeak -w temp.wav "%s" 2>>/dev/null' % a # speak aloud c = 'espeak -ven+f3 -k5 -s150 --punct="<characters>" "%s" 2>>/dev/null' % a #speak aloud execute_unix(b) execute_unix(c) 
+2
source

What exactly are you asking?

There is documentation here:

eSpeak Documentation

And samples:

eSpeak samples

If you have any doubts, we can help you.

+1
source

I use this at a moment that works well ... on my Raspberry Pi

 from subprocess import call call(["espeak","-s140 -ven+18 -z","Hello From Mike"]) 
+1
source

Source: https://habr.com/ru/post/1490472/


All Articles