OpenAI Whisper transcribe audio files gives Error - Request failed with status code 400

I have a little problem. I want to transcribe an audio file to text using OpenAI, but I get the following error message.

Error - Request failed with status code 400
{"error":{"message":"Invalid file format. Supported formats: ['m4a', 'mp3', 'webm', 'mp4', 'mpga', 'wav', 'mpeg']"," type":"invalid_request_error","param":null,"code":null}}

My file extension is “.m4a”, so I don’t know what the problem might be.

First, I upload the file to a DropBox folder, which I later upload to the temporary folder on Piperdream. From there, I try to pass it to the Open AI API, but it does not convert the sound to text, referring to the wrong extension.

I also upload from Dropbox to the Piperdream temporary folder using Dropbox’s official step. In fact use everywhere the official steps, not my own coding.

Can anyone help me to solve my problem?

Hi @Erik,

I’m sorry to hear that you’re experiencing issues with the transcription process. Since you’re using the official Dropbox and OpenAI steps, it’s possible that there might be an issue with the way the audio file is being passed to the OpenAI API.

To help you better, I would need more information about your workflow and the steps you’ve set up. Could you please provide more details on how you’re uploading the file to Dropbox, downloading it to the Pipedream temporary folder, and passing it to the OpenAI API? This will help me understand the issue and provide a solution.
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double check my answers and code! Learn how to build your own.

@pi

First I use Dropbox’s official step called “New file”. Everything is fine here, it recognizes the new file.

In the next step, I use the official step called “Download file to TMP”. With these parameters:

Path: {{steps.trigger.event.path_lower}}
File Name: {{steps.trigger.event.name}}

In the third step, I use OpenAI’s official step called “Create Transcription”. With these parameters:

Audio Upload Type: File
Language: hu
File Path: {{steps.download_file_to_tmp.$return_value.tmpPath}}
Prompt: -
Response Format: -
Temperature: -

This is where I get the error message in question.

Error - Request failed with status code 400
{"error":{"message":"Invalid file format. Supported formats: ['m4a', 'mp3', 'webm', 'mp4', 'mpga', 'wav', 'mpeg']"," type":"invalid_request_error","param":null,"code":null}}

Not sure, but try printing steps.download_file_to_tmp.$return_value.tmpPath to console and check it’s value

This is the File Path

/tmp/File_Name.m4a

@pi @techengine
This is the details of the error message:

at null.createError (/tmp/__pdg__/dist/code/4d17f5260907f527a06ec67798623979aa138f39e339b312a5241c4d5c109ad1/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/createError.js:16:15)
at null.settle (/tmp/__pdg__/dist/code/4d17f5260907f527a06ec67798623979aa138f39e339b312a5241c4d5c109ad1/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/tmp/__pdg__/dist/code/4d17f5260907f527a06ec67798623979aa138f39e339b312a5241c4d5c109ad1/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/adapters/http.js:269:11)
at IncomingMessage.emit (events.js:412:35)
at null.endReadableNT (internal/streams/readable.js:1333:12)
at process.processTicksAndRejections (internal/process/task_queues.js:82:21)

May be issue with this step