DeepHorizons / tts

A simple python TTS wrapper
51 stars 19 forks source link

Switching voices #1

Closed jason79 closed 7 years ago

jason79 commented 7 years ago

I'm trying to switch to "Ivona 2 Joey" but not sure how to do it.

import tts.sapi directory= 'D:\Google Drive\python\' voice = tts.sapi.Sapi() voice.set_voice("Ivona 2 Joey") voice.create_recording(directory+'hello.wav', "Hello")

error:

Voice not found

Traceback (most recent call last): File "D:\Google drive\python\test3.py", line 6, in voice.set_voice("Ivona 2 Joey") File "C:\Python27\lib\site-packages\tts\sapi.py", line 51, in set_voice self.voice.Voice = self.get_voices(voice)[0] IndexError: list index out of range

jason79 commented 7 years ago

I figured it out... it's "IVONA 2 Joey"

DeepHorizons commented 7 years ago

Also realize that it supports searching through the names. So instead of using the full name you could just use:

voice.set_voice("Joey")

It will use the first one it matches against, so be aware of that.