I receive a buffer through an input:
const fileData = Buffer.concat(chunks);
I then send this input into OpenAI's Whisper which excepts a file
const resp = await openai.createTranscription( //@ts-ignore
fileData,
"whisper-1",
);
This doesn't work so first I save the file to the disk
fs.writeFileSync("input.wav", fileData);
Then I read it again in the response function
const resp = await openai.createTranscription( //@ts-ignore
createReadStream("input.wav"),
"whisper-1",
);
This works but I don't want to save the file the disk every time I run the function. Is there a way to convert a buffer into the same NodeJS stream or achieve something with the same final output without saving it to the disk?