diff --git a/qt/aqt/sound.py b/qt/aqt/sound.py index 1b44adebc..64fdc6304 100644 --- a/qt/aqt/sound.py +++ b/qt/aqt/sound.py @@ -917,11 +917,13 @@ def setup_audio(taskman: TaskManager, base_folder: str) -> None: av_player.players.append(MacTTSPlayer(taskman)) elif isWin: - from aqt.tts import WindowsRTTTSFilePlayer, WindowsTTSPlayer + from aqt.tts import WindowsTTSPlayer av_player.players.append(WindowsTTSPlayer(taskman)) if platform.release() == "10": + from aqt.tts import WindowsRTTTSFilePlayer + # If Windows 10, ensure it's October 2018 update or later if int(platform.version().split(".")[-1]) >= 17763: av_player.players.append(WindowsRTTTSFilePlayer(taskman)) diff --git a/qt/aqt/tts.py b/qt/aqt/tts.py index 2536a8d56..467b6ee07 100644 --- a/qt/aqt/tts.py +++ b/qt/aqt/tts.py @@ -529,7 +529,7 @@ if isWin: tmppath = os.path.join(tmpdir(), "tts.wav") def import_voices(self) -> None: - import winrt.windows.media.speechsynthesis as speechsynthesis + import winrt.windows.media.speechsynthesis as speechsynthesis # type: ignore self.voice_list = speechsynthesis.SpeechSynthesizer.get_all_voices() @@ -569,8 +569,8 @@ if isWin: cb() async def speakText(self, tag: TTSTag, voice_id): - import winrt.windows.media.speechsynthesis as speechsynthesis - import winrt.windows.storage.streams as streams + import winrt.windows.media.speechsynthesis as speechsynthesis # type: ignore + import winrt.windows.storage.streams as streams # type: ignore synthesizer = speechsynthesis.SpeechSynthesizer()