nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
1.99k stars 321 forks source link

Add support for new natural voices by microsoft #291

Open Meshwa428 opened 9 months ago

Meshwa428 commented 9 months ago

It's been almost a year since Microsoft released 3 natural sounding voices for windows, namely Guy, Jenny and Aria. But still they are not supported by this library, it's my humble request please add those voices, because we beginner devs are tired of listening to that boring David.

TobiasTenhunen commented 8 months ago

You can actually add the voices if you want to.

Go to the Registry Editor > HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Speech_OneCore > Voices > Tokens. Here, export the voice that you want to use and edit the text file so that you replace all 'Speech_OneCore' to 'Speech', save it and open it with Registry Editor.

Meshwa428 commented 8 months ago

Oh they are not the natural voices I am talking about, Microsoft has introduced a feature to the narrator that is called natural voices and they are far more better than those windows sapi 5 voices

Meshwa428 commented 8 months ago

Any updates??

Meshwa428 commented 2 months ago

Any updates?

gexgd0419 commented 2 months ago

Seems that Microsoft hasn't allowed third-party apps to use those natural voices yet.

The Narrator natural voices are offline (embedded) versions of Azure AI Speech voices. Microsoft limits third-party access to embedded speech models, and requires submitting an application form if you want to use them.

However, if you want to have a try, here's my program called NaturalVoiceSAPIAdapter. After installation, it can make Narrator natural voices accessible to all SAPI 5 compatible programs, including pyttsx3.

Meshwa428 commented 2 months ago

Thanks 🙏, but will it work offline? And please tell me how I can use it with pyttsx3?

gexgd0419 commented 2 months ago

It supports both online voices (from Microsoft Edge read aloud feature) and offline voices (installed Narrator natural voices on your system). You can choose what to use in the installer.

After installing the program, the new natural voices will appear in the voice list of pyttsx3. You can get the voice list with engine.getProperty('voices'), and set which voice to use with engine.setProperty('voice', voice.id).

Note that this is not supported by Microsoft, and may stop working after some system update. You can try this yourself, but using this in production is not recommended.