0
engine = pyttsx.init()
voices = engine.getProperty('voices')
for voice in voices:
    engine.setProperty('voice', voice.id)
    engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait()

I tried this for loop from original documentation but there's only one voice on my machine. How can i download more voices?

Centrius
  • 3
  • 1
  • 3

2 Answers2

0

Well this is easy...

engine = pyttsx3.init('sapi5')

This is what you have to do to change voices.

Redgar Tech
  • 347
  • 3
  • 13
0

PYTTSX does not come with extra voices it only provides you the tools to access external TTS engines:

  1. SAPI5 on Windows XP and Windows Vista and Windows 8,8.1 , 10
  2. NSSpeechSynthesizer on Mac OS X 10.5 (Leopard) and 10.6 (Snow Leopard)
  3. espeak on Ubuntu Desktop Edition 8.10 (Intrepid), 9.04 (Jaunty), and 9.10 (Karmic)

So, if you need more voices, you should download them for appropriate backend.

More info can be found in docpage

Aleksey
  • 775
  • 5
  • 14