How can I send an audio file via Whisper API?

Hello. I tried many ways to use whisper API in React native and couldn’t get a result. I’m so confused now and I don’t know what to do. Here’s how far I’ve come: I recorded a sound with the react-native-audio-recorder-player package. The recording location of this sound is “file:///data/user/0/”. Now I will send this mp4 file to OpenAI’s whisper API. At this stage, I tried everything such as RNFS, blob, formdata etc. and could not get any results. Can someone please explain exactly what I should do at this stage?

texport const getCompletion5 = async (key) => {

    const configuration = new Configuration({ apiKey: key });
    const openai = new OpenAI(configuration);

    // sound file path
    const filePath = "file:///data/user/0/";

    // how should I prepare this??
    let audioFile;

    try {{
            file: audioFile,
            model: "whisper-1",
        }).then(transcription => {
            return transcription.text
        }).catch(error => {
            console.error("error 1:", error);

    } catch (error) {
        console.error("error 2:", error);


Are you using the openai-node package? At the bottom of the README on GitHub it states it currently does not support React Native

Yes, I use React Native, but this is not a problem. Because with additional settings, I was able to do everything except sending mp3 to whisper. But I haven’t figured out how to send mp3 to whisper yet.