newfies-dialer / python-msspeak

Text-To-Speech with MStranslate
MIT License
5 stars 5 forks source link

No longer working due to dependency issue #8

Open Lord-V15 opened 3 years ago

Lord-V15 commented 3 years ago

Hi, I was recently trying out the work done here but just importing msspeak returned me an error : cannot import name 'find_voice' from 'voices'

Screenshot 2021-08-03 at 6 13 22 PM

In such a scenario, can you help me fix this ?

m-weintraub commented 1 year ago

Does anyone know why this voices package was used? I can't find anything py-voices. All I can find is pyTTSx.

For a grin, I tried py-gTTS. It worked really easily. However, the language codes seem to be different from the language codes of MSFT (at least in its translation service). Does anyone know of a mapping between the two (goog<->MSFT)?

I did find this, and example to generate speech via a MSFT service: https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/python/text-to-speech

areski commented 1 year ago

I hard-coded the list of languages in this file: https://github.com/newfies-dialer/python-msspeak/blob/develop/msspeak/voices.py

Some might be outdated by now. Ideally we should fetch the list directly from MSFT API.

m-weintraub commented 1 year ago

I started down a similar path, adding a property to my Language class with translation names that MSFT uses to include a name that gTTS (nee google) uses. What I'm finding is, if gTTS supports a language, it tends to be the same iso-recognized name as what the MSFT services uses. However, sometimes there's an alternate name; some of the Chineses and Hebrew are two quick examples. I added a property for these and a try catch if the first name failed to retry the request using the alternate name.

Your solution is the better route. I'll try to get the languages from MSFT. If I have any success, I'll share. Thanks for sharing your file!