Skip to content

Commit

Permalink
Added Possibility for ESpeak Config (#3020)
Browse files Browse the repository at this point in the history
Added Possibility for ESpeak Config
  • Loading branch information
Genei180 committed Nov 9, 2021
1 parent ea15759 commit ef56d71
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions mycroft/tts/espeak_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,32 @@ def get_tts(self, sentence, wav_file):
Returns:
tuple ((str) file location, None)
"""
subprocess.call(['espeak', '-v', self.lang + '+' + self.voice,
'-w', wav_file, sentence])

# Create Argument String for Espeak
arguments = ['espeak', '-v', self.lang + '+' + self.voice]
amplitude = self.config.get('amplitude')
if amplitude:
arguments.append('-a '+amplitude)

gap = self.config.get('gap')
if gap:
arguments.append('-g '+gap)

capital = self.config.get('capital')
if capital:
arguments.append('-k '+capital)

pitch = self.config.get('pitch')
if pitch:
arguments.append('-p '+pitch)

speed = self.config.get('speed')
if speed:
arguments.append('-s '+speed)

arguments.extend(['-w', wav_file, sentence])

subprocess.call(arguments)
return wav_file, None


Expand Down

0 comments on commit ef56d71

Please sign in to comment.