mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix typechecking error on Windows
This commit is contained in:
parent
a70f8d4dd5
commit
65b8b8c69b
1 changed files with 2 additions and 2 deletions
|
@ -555,7 +555,7 @@ if is_win:
|
||||||
import winsdk.windows.media.speechsynthesis as speechsynthesis # type: ignore
|
import winsdk.windows.media.speechsynthesis as speechsynthesis # type: ignore
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.voice_list = speechsynthesis.SpeechSynthesizer.get_all_voices()
|
self.voice_list = speechsynthesis.SpeechSynthesizer.get_all_voices() # type: ignore
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("winsdk tts voices unavailable:", e)
|
print("winsdk tts voices unavailable:", e)
|
||||||
self.voice_list = []
|
self.voice_list = []
|
||||||
|
@ -605,7 +605,7 @@ if is_win:
|
||||||
|
|
||||||
synthesizer = speechsynthesis.SpeechSynthesizer()
|
synthesizer = speechsynthesis.SpeechSynthesizer()
|
||||||
|
|
||||||
voices = speechsynthesis.SpeechSynthesizer.get_all_voices()
|
voices = speechsynthesis.SpeechSynthesizer.get_all_voices() # type: ignore
|
||||||
voice_match = next(filter(lambda v: v.id == voice_id, voices))
|
voice_match = next(filter(lambda v: v.id == voice_id, voices))
|
||||||
|
|
||||||
assert voice_match
|
assert voice_match
|
||||||
|
|
Loading…
Reference in a new issue