TomFrankly / pipedream-notion-voice-notes

Take notes with your voice and send them to Notion
94 stars 49 forks source link

Invalid Duration Number #50

Closed rubinsandwich closed 7 months ago

rubinsandwich commented 7 months ago

I'm getting "invalid duration number (thrown from calculateTranscriptCost)" on about half of my audio file uploads. Not sure why it works sometimes and not others.

Error
Invalid duration number (thrown from calculateTranscriptCost). 
    at Object.calculateTranscriptCost (file:///pipedream/dist/code/.../code/Notion-Voice-Notes.mjs:1211:11)
    at Object.run (file:///pipedream/dist/code/.../code/Notion-Voice-Notes.mjs:2048:41)
    at null.executeComponent (/var/task/launch_worker.js:267:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:764:28)
(notion_voice_notes)
TomFrankly commented 7 months ago

@rubinsandwich what app are you using to record your files, and what format are they in? I've heard from a couple other folks that certain apps create weird .m4a files that can't be read for duration.

rubinsandwich commented 7 months ago

Not sure the app, as they were shared from a colleague, but they are in mp3 format. I chalked this up to you other comments on ChatGPT being above capacity. I haven't been able to get chunking files to work for any audio format for at least a week now. I recreated my token, recreated the Pipedream flow from scratch, and triple checked my billing but no luck. Works perfect for short files without chunking but 100% fail rate for a week with anything longer.

TomFrankly commented 7 months ago

@rubinsandwich duration is separate from ChatGPT issues, as I'm using the music-metadata npm package to get durations.

Aside from duration (which is 100% a conflict between your mp3 files and that npm package), I have noticed OpenAI having more platform instability lately. The other day, I processed a file that needed 3 chunks at the ChatGPT (not transcription) stage.

Chunks 1 and 3 were processed very quickly, but Chunk 2 took nearly 10 minutes. I'm on a paid Pipedream account, so I have my personal workflow set to timeout after 12 minutes instead of 5 – otherwise, it would have failed.

There might be some further optimizations I can make in that regard. In the mean time, I did ship a couple updates recently that may help with consistency - you can update like so: https://thomasjfrank.com/how-to-transcribe-audio-to-text-with-chatgpt-and-notion/#update

rubinsandwich commented 7 months ago

OK. It does seem to be an issue with the app or file format (mp3) for the audio. I tried a sample with iOS voice memos for a 45min recording and it worked fine. Thanks again for making such an amazing tool!