{"record":{"id":"8dcd7aebcea7407c","repo":"remotion-dev/remotion","slug":"only-supporting-wave-with-pcm-audio-format-but-go-8dcd7a","errorCode":null,"errorMessage":"Only supporting WAVE with PCM audio format, but got ${subFormat.length}","messagePattern":"Only supporting WAVE with PCM audio format, but got (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/wav/parse-fmt.ts","lineNumber":103,"sourceCode":"\t\ttype: 'wav-fmt',\n\t};\n\n\tstate.structure.getWavStructure().boxes.push(wavHeader);\n\n\tif (audioFormat === 65534) {\n\t\tconst extraSize = iterator.getUint16Le();\n\t\tif (extraSize !== 22) {\n\t\t\tthrow new Error(\n\t\t\t\t`Only supporting WAVE with 22 extra bytes, but got ${extraSize} bytes extra size`,\n\t\t\t);\n\t\t}\n\n\t\titerator.getUint16Le(); // valid bits per sample\n\t\tconst channelMask = iterator.getUint32Le();\n\t\tconst subFormat = iterator.getSlice(16);\n\t\t// check if same as [ 1, 0, 0, 0, 0, 0, 16, 0, 128, 0, 0, 170, 0, 56, 155, 113 ]\n\t\tif (subFormat.length !== 16) {\n\t\t\tthrow new Error(\n\t\t\t\t`Only supporting WAVE with PCM audio format, but got ${subFormat.length}`,\n\t\t\t);\n\t\t}\n\n\t\tif (subformatIsPcm(subFormat)) {\n\t\t\t// is pcm\n\t\t} else if (subformatIsIeeeFloat(subFormat)) {\n\t\t\t// is ieee float\n\t\t} else {\n\t\t\tthrow new Error(`Unsupported subformat: ${subFormat}`);\n\t\t}\n\n\t\tconst channels = getChannelsFromMask(channelMask);\n\t\twavHeader.numberOfChannels = channels.length;\n\t}\n\n\tawait registerAudioTrack({\n\t\ttrack: {","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/wav/parse-fmt.ts#L85-L121","documentation":"Inside the EXTENSIBLE branch the parser slices 16 bytes for the subFormat GUID and re-checks its length; if the underlying buffer had fewer than 16 bytes left (truncated fmt chunk) the slice is short and this throws. NOTE: the message is misleading — it says 'PCM audio format' but the real condition is subFormat.length !== 16. Treat it as a truncated-corrupt-header error, not a codec-compatibility error.","triggerScenarios":"A WAVE_FORMAT_EXTENSIBLE fmt chunk where fewer than 16 bytes remain after cbSize/valid-bps/channel-mask, so iterator.getSlice(16) returns a short slice.","commonSituations":"Truncated/partial download; stream cut off mid-fmt; corrupted fmt chunk bytes.","solutions":["Confirm the fmt chunk is intact (ffprobe loads the file cleanly).","Re-download or re-export the WAV.","Re-encode with ffmpeg to a clean PCM WAV.","Use Mediabunny; try/catch parseMedia()."],"exampleFix":"# verify integrity, then re-encode\nffprobe -v error in.wav && ffmpeg -i in.wav -c:a pcm_s16le out.wav\n\nawait parseMedia({ src: 'out.wav' });","handlingStrategy":"try-catch","validationCode":"// verify the fmt chunk is intact (file loads cleanly in ffprobe)\n// ffprobe -v error in.wav","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({ src: 'in.wav' });\n} catch (err) {\n  // NOTE: misleading message — this is really a truncated subFormat GUID\n  if (err instanceof Error && /PCM audio format, but got/.test(err.message)) {\n    // treat as corrupt header — re-download / re-encode\n  } else throw err;\n}","preventionTips":["Remember error 1425's message is misleading: it signals a truncated GUID, not a codec issue.","Re-download truncated assets before retrying.","Use Mediabunny."],"tags":["wav","media-parser","corrupt-file","audio","pcm"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}