Skip to content

Commit d70a4bf

Browse files
committed
fix: reduce audio chunk segment duration to fit Vercel's payload limit
Vercel serverless functions reject request bodies over 4.5 MB (FUNCTION_PAYLOAD_TOO_LARGE). The previous 600s segments produced ~9.4 MB chunks at 128 kbps, causing all chunks to fail in production. Reducing to 240s keeps each chunk under ~3.75 MB.
1 parent b0e14f4 commit d70a4bf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/helpers/ipcHandlers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,9 @@ class IPCHandlers {
21542154
chunksCompleted: 0,
21552155
});
21562156

2157-
const chunkPaths = await splitAudioFile(filePath, chunkDir);
2157+
const chunkPaths = await splitAudioFile(filePath, chunkDir, {
2158+
segmentDuration: 240, // ~3.75 MB/chunk, under Vercel's 4.5 MB payload limit
2159+
});
21582160
const totalChunks = chunkPaths.length;
21592161

21602162
debugLogger.debug("Audio split into chunks", { totalChunks });

0 commit comments

Comments
 (0)