-
Notifications
You must be signed in to change notification settings - Fork 4
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/confirmation_state #125
Conversation
The I think a better solution would be to roll this back to just play the sound in this service as it is in the latest stable release |
instant_listen is True by default remove_silence now is also True by default and removes the sound from the final recording |
Right, but |
the microphone plugin reads audio in a thread https://github.com/OpenVoiceOS/ovos-microphone-plugin-alsa/blob/dev/ovos_microphone_plugin_alsa/__init__.py#L42 blocking here has no impact in what audio makes it to STT, it will still record the sound ? instant_listen only made sense in the classic listener because it was blocking, it doesnt make sense in dinkum (i typed this before in more detail but accidentally deleted comment instead of editing 😫 ) also note instant_listen was not part of mycroft-core and was always flagged as experimental, so in my view backwards compat was not warranted anyway even if it made sense in dinkum-listener |
if we want to know when sound stops playing def _play_sound(self, uri: str, timeout=0.5, message: Optional[Message] = None):
message = message or Message("", context={
'client_name': 'ovos_dinkum_listener', 'source': 'listener',
'destination': ["audio"] # default native-source
})
self.bus.emit(message.forward("mycroft.audio.play_sound", {"uri": uri}))
# block waiting for ovos-audio to report sound finished playing
if not self.config.get("instant_listen", True):
sess = SessionManager.get(message)
SessionManager.wait_while_speaking(timeout=timeout, session=sess) we could use this to to know how much time (and therefore chunks) to drop from beginning of STT audio but i would put this into it's own flag and do it in a separated PR |
@NeonDaniel please re-review, given your feedback i added back the confirmation state, but with a dedicated handler for chunks during that period so that they can get dropped from the STT buffer (which didn't happen before) please test and manually inspect some recordings, as this can potentially crop the initial 0.5 seconds of audio |
@mikejgray and @goldyfruit can you verify this solves #107 ? please test with both instant_listen set to True and to False, and if possible with docker/voice satellite also. want to get this one right for this stable release :) |
handle confirmation state audio chunks in dedicated handler, drop those chunks from STT if instant_listen is False
closes #107
closes OpenVoiceOS/ovos-core#488
dynamically determines sound duration
without instant_listen
with instant_listen