Using the following code. Found, that it automatically fix grammar errors, which user done during saying voice message:

require('dotenv').config()
const { Configuration, OpenAIApi } = require("openai");

const path = require("path");
const fs = require("fs")

const convertTransScript = async () => {
    const filePath = path.join(__dirname, 'sample.mp3');

    const configuration = new Configuration({
        apiKey: process.env.OPEN_AI_APK_KEY
    });

    const openai = new OpenAIApi(configuration);
    const resp = await openai.createTranscription(
        fs.createReadStream(filePath),
        "whisper-1"
    ).catch((resError) => {
        console.error(JSON.stringify(resError))
    })

    console.log("RES",resp)
}
convertTransScript();




How to adjust it to make Whisper API not fix the errors (give just the RAW voice input)? Thank you

1 Like