mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Merge d7a802a2d8 into dac26ce671
This commit is contained in:
commit
91175c5c1b
1 changed files with 12 additions and 2 deletions
|
|
@ -94,8 +94,18 @@ class TTSPlayer:
|
||||||
|
|
||||||
rank -= 1
|
rank -= 1
|
||||||
|
|
||||||
# if no preferred voices match, we fall back on language
|
# if no requested voices match, use a preferred fallback voice
|
||||||
# with a rank of -100
|
# (for example, Apple Samantha) with rank of -50
|
||||||
|
for avail in avail_voices:
|
||||||
|
if avail.lang == tag.lang:
|
||||||
|
if (
|
||||||
|
avail.lang == "en_US"
|
||||||
|
and avail.name == "Apple_Samantha_(English_(US))"
|
||||||
|
):
|
||||||
|
return TTSVoiceMatch(voice=avail, rank=-50)
|
||||||
|
|
||||||
|
# if no requested or preferred voices match, we fall back on
|
||||||
|
# the first available voice for the language, with a rank of -100
|
||||||
for avail in avail_voices:
|
for avail in avail_voices:
|
||||||
if avail.lang == tag.lang:
|
if avail.lang == tag.lang:
|
||||||
return TTSVoiceMatch(voice=avail, rank=-100)
|
return TTSVoiceMatch(voice=avail, rank=-100)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue