OpenVoiceOS / OpenVoiceOS/ovos-stt-server-plugin

response json format problems with streaming stt

Open
#6 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2
Forks
6
Avg merge
4d 16m
Merged PRs (30d)
1

Description

endpoint https://stt.openvoiceos.com/stt

 Exception in thread Thread-6:
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: Traceback (most recent call last):
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/local/lib/python3.9/dist-packages/requests/models.py", line 971, in json
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     return complexjson.loads(self.text, **kwargs)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     return _default_decoder.decode(s)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     raise JSONDecodeError("Expecting value", s, err.value) from None
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: During handling of the above exception, another exception occurred:
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: Traceback (most recent call last):
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     self.run()
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/local/lib/python3.9/dist-packages/ovos_plugin_manager/templates/stt.py", line 167, in run
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     return self.handle_audio_stream(self._get_data(), self.language)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/local/lib/python3.9/dist-packages/ovos_stt_plugin_server/__init__.py", line 42, in handle_audio_stream
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     self.text = response.json()["transcript"]
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/local/lib/python3.9/dist-packages/requests/models.py", line 975, in json
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at ovos_stt_plugin_server/init.py in handle_audio_stream and reproduce the request against https://stt.openvoiceos.com/stt, inspecting the response body before the transcript lookup. Done means the streaming STT response can be parsed and the transcript is obtained without JSONDecodeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.