jdlorimer/chinese-support-redux

Sound autofill does not work for Pleco generated cards

Closed this issue · 3 comments

Describe the bug
I am trying to use sound autofill for cards that I added in Pleco. For other cards in the same deck, everything was fine. The error is the same no matter which TTS engine I use.

To Reproduce
I am not quite sure how to achieve this. I have some new cards in my default deck. They have different fields (Hanzi, Meaning, Pinyin, Color, Audio, Example). With the bulk fill, I want to get the audio from the Hanzi in the audio field. However, all I get is failed notes.
I have some card in the same deck that were created directly in Anki, here autofill worked like a charm.
Steps to reproduce the behavior:

  1. Go to 'Chinese, Bulk fill, Sound'
  2. See error (below)

Expected behavior
I would expect that the Audio column is filled with the corresponding audio. I also gave different names to that column (Sound). That did not change anything

Specs (please complete the following information):

  • OS: [e.g. Windows 10]
  • Anki Version [v2.1.35]
  • Chinese Support Version [v0.5.3-beta] (most up to date I believe)

Additional context
The error message is as follows:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-12-21 11:52:42

Caught exception:
Traceback (most recent call last):
File "C:\Users\karla\AppData\Roaming\Anki2\addons21\1128979221\fill.py", line 154, in bulk_fill_sound
s, f = fill_sound(hanzi, copy)
File "C:\Users\karla\AppData\Roaming\Anki2\addons21\1128979221\behavior.py", line 169, in fill_sound
s = sound(hanzi, config['speech'])
File "C:\Users\karla\AppData\Roaming\Anki2\addons21\1128979221\sound.py", line 51, in sound
return '[sound:%s]' % AudioDownloader(hanzi, source).download()
File "C:\Users\karla\AppData\Roaming\Anki2\addons21\1128979221\tts.py", line 50, in download
self.func()
File "C:\Users\karla\AppData\Roaming\Anki2\addons21\1128979221\tts.py", line 73, in get_baidu
with open(self.path, 'wb') as audio:
OSError: [Errno 22] Invalid argument: 'C:\Users\karla\AppData\Roaming\Anki2\User 1\collection.media\耳機\n_baidu_zh.mp3'

This should be fixed with the version I'll be uploading later today, but I'll leave this issue open just in case.

@karl-an Can you confirm if you are still experiencing this issue?

@karl-an Can you confirm if you are still experiencing this issue?

No, it was working very well lately.