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

refactor/opm #39

Closed
wants to merge 14 commits into from
Closed

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
Copy link
Member

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

neon_audio/tts/neon.py Outdated Show resolved Hide resolved
neon_audio/tts/neon.py Outdated Show resolved Hide resolved
neon_audio/tts/neon.py Outdated Show resolved Hide resolved
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,
Copy link
Member

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

Copy link
Author

@NeonJarbas NeonJarbas Nov 11, 2021

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
Copy link
Member

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)

Copy link
Author

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)
Copy link
Member

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]:

Copy link
Author

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?

@NeonJarbas
Copy link
Author

this PR always included the translated and untranslated versions if needed, it uses both lang and self.lang if they are different

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.

3 participants