Trouble adding TTS to my cards

I primarily use the Anking deck for my studies and am trying to use the TTS included in the card template:
{{tts en_US voices=Apple_Samantha speed=1.4:cloze:Text}}

However, I receive and error message (pasted below).

I have tried to change the voice to a Microsoft_David. I have tried to add TTS to a completely blank deck and new card template. I have loaded with disabling add-ons. I have run Check Database and Check Media. I have tried to add text-to-speech with HyperTTS add-on. I have updated my Anki to the latest version.

None of these solutions have worked. Any advice would be appreciated. Thank you.

Error
An error occurred. Please use Tools > Check Database to see if that fixes the problem.
If problems persist, please report the problem on our support site. Please copy and paste the information below into your report.
Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
Platform: Windows 10
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2022-07-26 21:41:44

Caught exception:
Traceback (most recent call last):
File “aqt.webview”, line 42, in cmd
File “aqt.webview”, line 149, in _onCmd
File “aqt.webview”, line 624, in _onBridgeCmd
File “aqt.clayout”, line 417, in _on_bridge_cmd
File “aqt.sound”, line 833, in play_clicked_audio
File “aqt.sound”, line 150, in play_tags
File “aqt.sound”, line 209, in _play_next_if_idle
File “aqt.sound”, line 212, in _play
File “aqt.sound”, line 223, in _best_player_for_tag
File “aqt.tts”, line 111, in rank_for_tag
File “aqt.tts”, line 76, in voice_for_tag
File “aqt.tts”, line 72, in voices
File “aqt.tts”, line 492, in get_available_voices
File “aqt.tts”, line 495, in
File “aqt.tts”, line 501, in _voice_to_objects
File “<COMObject >”, line 3, in GetAttribute
pywintypes.com_error: (-2147352567, ‘Exception occurred.’, (0, None, None, None, 0, -2147200966), None)

1 Like

The error seems to imply there’s something wrong with Windows’ TTS support.

Thanks! I was having trouble interpreting the error code.
TTS seems to work outside of Anki.

It appears that one of the voices on your system doesn’t have a name, and Anki is assuming every voice will have a name. If you can identify the problem one and remove it, it may resolve the issue.

1 Like