-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor/opm #39
refactor/opm #39
Conversation
@@ -62,7 +61,7 @@ def main(ready_hook=on_ready, error_hook=on_error, stopping_hook=on_stopping, co | |||
if get_neon_device_type() == 'server': | |||
audio = None | |||
else: | |||
audio = AudioService(bus, config) # Connect audio service instance to message bus | |||
audio = AudioService(bus) # Connect audio service instance to message bus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need a call to export config if we're not passing it directly here
tx_kwargs = dict(kwargs) | ||
tx_kwargs["lang"] = self.lang | ||
wav_file, phonemes = self._get_tts(tx_sentence, **tx_kwargs) | ||
responses[self.lang] = {"sentence": tx_sentence, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like responses['lang']
, not self.lang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nvm, i misread)
self.cached_translations[lang][sentence] = tx_sentence | ||
self.cached_translations.store() | ||
tx_kwargs = dict(kwargs) | ||
tx_kwargs["lang"] = self.lang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be lang
to match the language of the passed string (tx_sentence
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did i miss something, lang is the untranslated version, self.lang is the translated one, both are included
self.cached_translations.store() | ||
sentence = self.cached_translations[lang][sentence] | ||
request["translated"] = True | ||
lang = kwargs["lang"] = request["language"] | ||
wav_file, phonemes = self._get_tts(sentence, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this belongs in the else
of:
# translate if needed
if lang.split("-")[0] != self.lang.split("-")[0]:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im confused, do we not always want both ? why does it go in the else?
this PR always included the translated and untranslated versions if needed, it uses both |
migration to OPM, not ready! sharing for early input
related PRs:
test branch used for dev https://github.com/NeonJarbas/OVOS-plugin-manager/tree/playground