Use prefix match for Apple Samantha voice fallback

This commit is contained in:
leedoughty 2025-11-10 18:15:57 +00:00 committed by Lee Doughty
parent db95bb7c05
commit 90308dd880

View file

@ -98,10 +98,7 @@ class TTSPlayer:
# (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))"
):
if avail.lang == "en_US" and avail.name.startswith("Apple_Samantha"):
return TTSVoiceMatch(voice=avail, rank=-50)
# if no requested or preferred voices match, we fall back on