Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AttributeError with VocalWare #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

szpak
Copy link

@szpak szpak commented Feb 8, 2024

options['voice'] for VocalWare is a nested dictionary instead of just a string.
E.g. VocalWare ({'engine_id': 3, 'language_id': 1, 'voice_id': 4})

Fallback to unknown to avoid the exception:

Caught exception:
Traceback (most recent call last):
  File "/home/foo/.local/share/Anki2/addons21/1436550454/awesometts/router.py", line 970, in _on_worker_signal
    self._threads[thread_id]['callback'](exception)
  File "/home/foo/.local/share/Anki2/addons21/1436550454/awesometts/router.py", line 547, in completion_callback
    callbacks['okay'](human(path))
  File "/home/foo/.local/share/Anki2/addons21/1436550454/awesometts/router.py", line 483, in human
    filename = RE_MUSTACHE.sub(substitute, want_human)
  File "..../awesometts/router.py", line 467, in substitute
    return options['voice'].lower()
AttributeError: 'dict' object has no attribute 'lower'

It's just a quick fix, file names with different language settings could override in a corner case. However, I have no short and universal solution to extract all the (meaningful) attributes to string.

options['voice'] for VocalWare is nested dictionary instead of string.
E.g. VocalWare ({'engine_id': 3, 'language_id': 1, 'voice_id': 4})

Fallback to 'unknown' to avoid an exception:

...
File "..../awesometts/router.py", line 467, in substitute
  return options['voice'].lower()
AttributeError: 'dict' object has no attribute 'lower'

It's just a quick fix, file names with different language settings
could override in a corner case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant