TomFrankly / pipedream-notion-voice-notes

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

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'] #14

Closed Cryptowarrior92 closed 1 year ago

Cryptowarrior92 commented 1 year ago

Love your work - here my bug report.

I tried to upload m4a files, which I recorded with the app Voice Recorder on Android. I tried it with 3 different files with different lengths. The error code is always the same, it occurs at the step: notion_voice_notes

One was 26 seconds, the other one was 7 seconds. The third one which was 76 seconds: 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)

The second one which was 26 seconds

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)

The first voice message which was 9 seconds long:

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)

Cryptowarrior92 commented 1 year ago

Now I tried it with the Android App called MP3 Recorder - 21 seconds voice message duration.

A different error appeared now:

APIResponseError
body failed validation: body.children[6].bulleted_list_item.rich_text[0].text.content should be a string, instead was `{"story":"The speaker once encountered a similar issue ...`. 
    at null.buildRequestError (/pipedream/dist/code/2877cde0cb601751826e758c481d9e35ace6f9c6c767176b83320fa7861e6f28/node_modules/.pnpm/@notionhq+client@2.2.13/node_modules/@notionhq/client/build/src/errors.js:162:16)
    at Client.request (/pipedream/dist/code/2877cde0cb601751826e758c481d9e35ace6f9c6c767176b83320fa7861e6f28/node_modules/.pnpm/@notionhq+client@2.2.13/node_modules/@notionhq/client/build/src/Client.js:378:54)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.retry.retries (file:///pipedream/dist/code/2877cde0cb601751826e758c481d9e35ace6f9c6c767176b83320fa7861e6f28/code/Notion-Voice-Notes.mjs:1746:23)
(notion_voice_notes)
Cryptowarrior92 commented 1 year ago

So I figured out a working solution:

That solved the problem and a perfect note was created. 🥳🚀

TomFrankly commented 1 year ago

@Cryptowarrior92 glad you got it to work! The final error you got seems like a ChatGPT error; it seems to have written JSON where it should have just written a string.

I've tested Stories out myself quite a bit and haven't hit that error. Did you happent to change the temperature setting in Advanced Settings?

PS I've just shipped an update.

Here are the release notes for the newest version: https://github.com/TomFrankly/pipedream-notion-voice-notes/releases/tag/v0.7.0

Cryptowarrior92 commented 1 year ago

Amazing that you shipped a new version. 😍

Did you happent to change the temperature setting in Advanced Settings?

No I didn't change the termperature settings.

I'll test the "Stories" with the new version.

Cryptowarrior92 commented 1 year ago

Great 🥳.

✅ Stories works ✅ .wav format works