How to add more speakers and their voices in pyttsx3 offline text to speech..

Puneet Singh
4 min readNov 7, 2020

--

Photo by CHUTTERSNAP on Unsplash

I was working a project which were related to it For that needed more speaker and their voices .Searched many times on web and find different different places. but solution didn’t found. after many days research found a solution to how to add more speakers and their voices in pyttsx3.

So. like me there is many students and project managers and developers working on this kind of projects . So it is helpful for them.

We already known there is only two default system speakers and their voices are available in Microsoft window or pyttsx3.

prerequisite —

1-Install pyttsx3 (pip install pyttsx3) in your local machine.

2-Window 8,8.1 or 10 installed in your system.

3-Any python environment and IDE required like pycharm, jupyter notebook, conda etc.

Let look how to find how many speakers and their voices default supported by window or pyttsx3.

import pyttsx3
engine = pyttsx3.init()
voices = engine.getProperty('voices')
for voice in voices:
print(voice, voice.id)
engine.setProperty('voice', voice.id)
engine.say("Hello World!")
engine.runAndWait()
engine.stop()

Right here , by default we found only two speakers and their voices.

1-David

2-Zira

It was not sufficient for my project. so that i wanted to add more voices and speakers.

Let see how we can do it.

Now, follow all those images and steps to understand how we can add more speakers and their voices in pyttsx3 step by step -

Press window + Control + n .After press follow all the images given below

Follow all the steps-

Now after successfully added the English(Canada) voice . now time to check in pyttsx3 English(Canada) speaker(voice) is available or not .

For that write some python script once again to verify that.

import pyttsx3
engine = pyttsx3.init()
voices = engine.getProperty('voices')
for voice in voices:
print(voice, voice.id)
engine.setProperty('voice', voice.id)
engine.say("Hello World!")
engine.runAndWait()
engine.stop()

Congratulation your English(Canada) speaker and voice has been added successfully.

Same like this. you can added more speakers and their voices.

If any doubt regarding it. please comment below and ask feel free.

If any doubt regarding this tutorial ask feel free on LinkedIn- http://linkedin.com/in/puneet166

GitHub workspace link- https://github.com/puneet166?tab=repositories

--

--