Skip to content
Browse files

Fix for issue #9, use VoiceLocaleIdentifier when available on OSX

  • Loading branch information...
1 parent ea3f9f8 commit a9a54bc94f9449ad0e55e3ef7d5cd18de361a88d @parente committed
Showing with 10 additions and 1 deletion.
  1. +5 −0 docs/changelog.rst
  2. +5 −1 pyttsx/drivers/nsss.py
View
5 docs/changelog.rst
@@ -1,6 +1,11 @@
Changelog
---------
+Version 1.2
+~~~~~~~~~~~
+
+* Fixed voice selection to use VoiceLocaleIdentifier on OS X instead of deprecated VoiceLanguage
+
Version 1.1
~~~~~~~~~~~
View
6 pyttsx/drivers/nsss.py
@@ -66,8 +66,12 @@ def stop(self):
self._tts.stopSpeaking()
def _toVoice(self, attr):
+ try:
+ lang = attr['VoiceLocaleIdentifier']
+ except KeyError:
+ lang = attr['VoiceLanguage']
return Voice(attr['VoiceIdentifier'], attr['VoiceName'],
- [attr['VoiceLanguage']], attr['VoiceGender'],
+ [lang], attr['VoiceGender'],
attr['VoiceAge'])
def getProperty(self, name):

0 comments on commit a9a54bc

Please sign in to comment.
Something went wrong with that request. Please try again.