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

Empty utterance error #147

Closed
timonvanhasselt opened this issue Oct 7, 2024 · 2 comments · Fixed by #150
Closed

Empty utterance error #147

timonvanhasselt opened this issue Oct 7, 2024 · 2 comments · Fixed by #150
Assignees

Comments

@timonvanhasselt
Copy link

When a user doesn't say something after the wake word, it's noticed as full silence in the log. But the empty utterance triggers chatgpt fallback at my end. Wouldn't it be more logical to see an empty utterance as a "nevermind"/ cancel?

2024-10-07 18:23:01.580 - voice - ovos_dinkum_listener.voice_loop.voice_loop:run:262 - DEBUG - waiting for speech
2024-10-07 18:23:01.581 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_before_cmd:608 - DEBUG - STATE: ListeningState.AFTER_COMMAND
2024-10-07 18:23:01.709 - voice - ovos_dinkum_listener.voice_loop.voice_loop:run:268 - INFO - speech finished
2024-10-07 18:23:01.710 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_vad_remove_silence:751 - DEBUG - recorded 2.816 seconds of audio
2024-10-07 18:23:01.752 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_vad_remove_silence:755 - DEBUG - audio appears to be full silence! skipping VAD silence removal
2024-10-07 18:23:02.412 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_get_tx:714 - ERROR - STT failed
Traceback (most recent call last):
  File "/home/ovos/.venvs/ovos/lib/python3.11/site-packages/ovos_dinkum_listener/voice_loop/voice_loop.py", line 712, in _get_tx
    utts = self.stt.transcribe() or []
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/.venvs/ovos/lib/python3.11/site-packages/ovos_dinkum_listener/plugins.py", line 67, in transcribe
    transcripts = self.engine.transcribe(audiod, lang)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/.venvs/ovos/lib/python3.11/site-packages/ovos_plugin_manager/templates/stt.py", line 130, in transcribe
    return [(self.execute(audio, lang), 1.0)]
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/.venvs/ovos/lib/python3.11/site-packages/ovos_stt_plugin_chromium/__init__.py", line 245, in execute
    data = json.loads(result)["result"]
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-10-07 18:23:02.413 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_get_tx:718 - INFO - Attempting fallback STT plugin
2024-10-07 18:23:02.582 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_after_cmd:786 - DEBUG - transformers metadata: {'client_name': 'ovos_dinkum_listener', 'source': 'audio', 'destination': ['skills'], 'transcriptions': [('', 1.0)]}
2024-10-07 18:23:02.582 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_after_cmd:787 - INFO - transcribed: [('', 1.0)]
2024-10-07 18:23:02.583 - voice - ovos_dinkum_listener.service:_record_end_signal:650 - DEBUG - Record end
2024-10-07 18:23:02.584 - voice - ovos_dinkum_listener.service:_stt_text:667 - DEBUG - STT: ['']
@JarbasAl JarbasAl self-assigned this Oct 7, 2024
@goldyfruit
Copy link
Member

This happens as well when running in a CLI, if the skill asks a question and waits for an answer (like yes/no), then the listener will generate this trace even if "yes" got answered from the CLI.

@JarbasAl
Copy link
Member

This happens as well when running in a CLI, if the skill asks a question and waits for an answer (like yes/no), then the listener will generate this trace even if "yes" got answered from the CLI.

thats because get_response activates the microphone, when you type an answer in the cli you are actually sending 2 utterances

the cli pretends to be audio, so it is "expected"

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 a pull request may close this issue.

3 participants