Hello,
I’m trying to run the example for speach to text, but I encounter this error:
Traceback (most recent call last):
File "/home/jrocha/projects/voice/test.py", line 10, in <module>
transcript = openai.Audio.transcribe("whisper-1", audio_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jrocha/projects/voice/venv/lib/python3.11/site-packages/openai/api_resources/audio.py", line 65, in transcribe
response, _, api_key = requestor.request("post", url, files=files, params=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jrocha/projects/voice/venv/lib/python3.11/site-packages/openai/api_requestor.py", line 220, in request
result = self.request_raw(
^^^^^^^^^^^^^^^^^
File "/home/jrocha/projects/voice/venv/lib/python3.11/site-packages/openai/api_requestor.py", line 520, in request_raw
result = _thread_context.session.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jrocha/projects/voice/venv/lib/python3.11/site-packages/requests/sessions.py", line 573, in request
prep = self.prepare_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jrocha/projects/voice/venv/lib/python3.11/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/home/jrocha/projects/voice/venv/lib/python3.11/site-packages/requests/models.py", line 371, in prepare
self.prepare_body(data, files, json)
File "/home/jrocha/projects/voice/venv/lib/python3.11/site-packages/requests/models.py", line 556, in prepare_body
(body, content_type) = self._encode_files(files, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jrocha/projects/voice/venv/lib/python3.11/site-packages/requests/models.py", line 191, in _encode_files
fdata = fp.read()
^^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9e in position 14: invalid start byte
I have tried .mp3, .m4a and .ogg files but they all give back the same result.
Any help would be appreciated.