8000 fixed language property for voice by ekalosak · Pull Request #7 · Jiangshan00001/pyttsx4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fixed language property for voice #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

ekalosak
Copy link
@ekalosak ekalosak commented Jun 11, 2023

re: #6

The VoiceLanguage property is indeed provided by the AppKit.NSSpeechSynthesis interface:

>>> from AppKit import NSSpeechSynthesis
>>> NSSpeechSynthesizer.attributesForVoice_("com.apple.speech.synthesis.voice.zuzana")['VoiceLanguage']
'cs-CZ'

I'm certain there was a good reason for using the VoiceIdentity in place of the VoiceLanguage, but it breaks the contract expected by the Voice object. This PR ostensibly fixes that.

Checking every available voice on MacOS Monterey:

>>> langs = list(NSSpeechSynthesizer.availableVoices())
>>> for lang in langs:                                    
...     print(lang)                                       
...     print(NSSpeechSynthesizer.attributesForVoice_(lang)['VoiceLanguage'])
...                                                      
com.apple.speech.synthesis.voice.Alex                    
en-US                                                    
com.apple.speech.synthesis.voice.alice                   
it-IT                                                    
com.
8000
apple.speech.synthesis.voice.alva                    
sv-SE
com.apple.speech.synthesis.voice.amelie                  
fr-CA                                                    
com.apple.speech.synthesis.voice.anna
de-DE                                                    
com.apple.speech.synthesis.voice.carmit
he-IL                                                    
com.apple.speech.synthesis.voice.damayanti
id                                                       
com.apple.speech.synthesis.voice.daniel
en-GB                                                    
com.apple.speech.synthesis.voice.diego
es-ES                                                    
com.apple.speech.synthesis.voice.ellen
nl-BE                                                    
com.apple.speech.synthesis.voice.fiona
en-US                                                    
com.apple.speech.synthesis.voice.Fred
en-US                                                    
com.apple.speech.synthesis.voice.ioana
ro-RO                                                    
com.apple.speech.synthesis.voice.joana
pt-PT                                                    
com.apple.speech.synthesis.voice.jorge
es-ES                                                    
com.apple.speech.synthesis.voice.juan
es-419                                                   
com.apple.speech.synthesis.voice.kanya
th-TH                                                    
com.apple.speech.synthesis.voice.karen
en-AU                                                    
com.apple.speech.synthesis.voice.kyoko
ja-JP                                                    
com.apple.speech.synthesis.voice.laura
sk-SK                                                    
com.apple.speech.synthesis.voice.lekha
hi-IN                                                    
com.apple.speech.synthesis.voice.luca
it-IT                                                    
com.apple.speech.synthesis.voice.luciana
pt-BR                                                    
com.apple.speech.synthesis.voice.maged
ar                                                       
com.apple.speech.synthesis.voice.mariska
hu-HU                                                    
com.apple.speech.synthesis.voice.meijia
zh-Hant
com.apple.speech.synthesis.voice.melina
el-GR                                                    
com.apple.speech.synthesis.voice.milena
ru-RU                                                    
com.apple.speech.synthesis.voice.moira
en-IE                                                    
com.apple.speech.synthesis.voice.monica
es-ES                                                    
com.apple.speech.synthesis.voice.nora
nb-NO                                                    
com.apple.speech.synthesis.voice.paulina
es-419                                                   
com.apple.speech.synthesis.voice.rishi
en-US                                                    
com.apple.speech.synthesis.voice.samantha
en-US                                                    
com.apple.speech.synthesis.voice.sara
da-DK                                                    
com.apple.speech.synthesis.voice.satu
fi-FI                                                    
com.apple.speech.synthesis.voice.sinji
zh-Hant                                                  
com.apple.speech.synthesis.voice.tessa
en-US                                                    
com.apple.speech.synthesis.voice.thomas
fr-FR                                                    
com.apple.speech.synthesis.voice.tingting
zh-Hans                                                  
com.apple.speech.synthesis.voice.veena
en-US                                                    
com.apple.speech.synthesis.voice.Victoria
en-US                                                    
com.apple.speech.synthesis.voice.xander
nl-NL                                                    
com.apple.speech.synthesis.voice.yelda
tr-TR                                                    
com.apple.speech.synthesis.voice.yuna
ko-KR                                                    
com.apple.speech.synthesis.voice.yuri
ru-RU                                                    
com.apple.speech.synthesis.voice.zosia
pl-PL                                                    
com.apple.speech.synthesis.voice.zuzana
cs-CZ 

It seems like it's worth opening a discussion about pyttsx4's path forward in the face of NSSpeechSynthesis deprecation: https://developer.apple.com/documentation/appkit/nsspeechsynthesizer but that is out of scope for this PR, at least.

@Jiangshan00001 Jiangshan00001 merged commit 332215e into Jiangshan00001:master Jun 14, 2023
@Jiangshan00001
Copy link
Owner

thanks!
the code become better because of you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0