TomFrankly / pipedream-notion-voice-notes

Take notes with your voice and send them to Notion
103 stars 55 forks source link

Mp3 file works, same spoken memo 01:47 in m4a gives error #20

Closed Retepfoh closed 1 year ago

Retepfoh commented 1 year ago

Error An error occured while attempting to split the file into chunks, or while sending the chunks to OpenAI: 400 Invalid file format. Supported formats: ['flac', 'm4a', 'mp3', 'mp4', 'mpeg', 'mpga', 'oga', 'ogg', 'wav', 'webm'] at Object.chunkFileAndTranscribe (file:///pipedream/dist/code/2877cde0cb601751826e758c481d9e35ace6f9c6c767176b83320fa7861e6f28/code/Notion-Voice-Notes.mjs:363:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at Object.run (file:///pipedream/dist/code/2877cde0cb601751826e758c481d9e35ace6f9c6c767176b83320fa7861e6f28/code/Notion-Voice-Notes.mjs:1859:22) at null.executeComponent (/var/task/launch_worker.js:229:22) at MessagePort.messageHandler (/var/task/launch_worker.js:726:28) (notion_voice_notes)

TomFrankly commented 1 year ago

Hi @Retepfoh, what app are you using to create your files? I'm guessing you are using a mp3 or m4a since your file passed my initial file type check and actually got sent to OpenAI. So it looks like their endpoint is failing on a valid file type.

Retepfoh commented 1 year ago

Hi @TomFrankly, correct, i made a recording through an android voicerecorder app, same recording in mp3 and m4u, but m4u didnt get accepted by openai. m4a is the native format in the samsung voice recorder app, for testing reasons i also recorded a memo in mp3 with another app (simple mobile tools / simple voice recorder), and that gave no problems.

TomFrankly commented 1 year ago

Ok, I'm thinking that some apps create m4a files that have odd properties Whisper doesn't like. I'm looking into adding an mp3 conversion fallback, but I need to see whether or not it's fast enough. If it's not, then your best bet will be to upload mp3 files.

TomFrankly commented 1 year ago

Update: mp3 conversion doesn't seem to be working on Pipedream; for some reason, it takes a really long time and times out when converting from m4a to mp3.

For now, I'll recommend upload mp3 files, or trying a different voice-recorder app. m4a should work, so I think it comes down to peculiarities in the files generated by certain apps.