Hey there,
I have created some Media Objects from the client code using some code from this thread. This audio is captured from the user’s device’s microphone and stored as a media object.
However, when trying to pass the media object to Whisper’s Transcription API, I’m not able to provide it in an acceptable format. I first tried to pass the Media Object directly, but it seems to expect bytes. So I used get_bytes() to convert the media object into bytes (and printed it to make sure it is working).
However, when trying to pass the audio file’s bytes to the API, I get:
AttributeError: 'bytes' object has no attribute 'name'
at /home/anvil/.env/lib/python3.10/site-packages/openai/api_resources/audio.py:57
Any ideas how I can get the data over there? I even tried passing it as a URL, but the URL generated by the Media Object is not accessible outside of the app.