-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Handle STT fallback when streaming plugins return nothing #232
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #232 +/- ##
==========================================
+ Coverage 50.35% 54.81% +4.46%
==========================================
Files 119 156 +37
Lines 10077 9313 -764
==========================================
+ Hits 5074 5105 +31
+ Misses 5003 4208 -795
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -199,6 +199,8 @@ def send_unknown_intent(): | |||
with self.loop.lock: | |||
try: | |||
text = self.loop.stt.execute(audio, language=lang) | |||
if text is None: |
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.
should we handle empty strings to? maybe use if not text
and catch all falsy values
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.
makes sense; I think None
is the default in plugins when nothing sets self.text
, but its ultimately up to the plugin author what they return. No reason not to fall back if the base STT didn't recognize anything, it can't hurt..
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.
On another read, the check right after this will handle an empty string as valid STT, is this part of the API or should that check also be reversed to:
if not text:
send_unknown_intent()
else:
...
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.
if both fallback and main stt return an empty string i think that means silent audio and is a valid transcription no?
i want fallback to try a new transcript if main return empty string, but if both return empty then i think the old logic is valid
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.
re-reading code, i think that change makes sense in the below lines
No description provided.