#Couldn't pass mp3 audio to whisper api using react

10 messages · Page 1 of 1 (latest)

hidden timber
#

I want to use whisper api.
The data will be from user microphone.
I don't want to upload the data to server, so just using client side only using react.

I have a problem how can I pass the mp3 audio.
I can't use fs.
I also tried to put blob to the first param but had no luck.

const resp = await openai.createTranscription(
fs.createReadStream("audio.mp3"),
"whisper-1"
);

Anyone know how to do this ?

normal ravine
#

But when you call createTranscription, it does indeed upload the data to the OpenAI servers

hidden timber
#

That’s ok, what I mean I don’t want to upload user data to my server. Currently I can use the api, but I save the audio to my server then upload to open AI server.

waxen grail
hidden timber
#

I can but I need to upload the mp3 from user to my server.

regal anvil
#

you need to use multiform and then send the mp3 and use proxy server to sed it to OpenAi

#

btw maybe using openAI model doesn't make sens as whisper open?

#

but not suere about it, really

#

with this "I don't want to upload the data to server, so just using client side only using react." it will suck - if you want to make the app global as your token for open AI will be visible

#

and the guy like me will for sure use it 😄