{"record":{"id":"84c56b7ee0865837","repo":"remotion-dev/remotion","slug":"only-supporting-wave-with-pcm-audio-format-but-go","errorCode":null,"errorMessage":"Only supporting WAVE with PCM audio format, but got ${audioFormat}","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":56,"sourceCode":"\t\t\t\tchannels.push(`Unknown Channel (bit ${bit})`);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn channels;\n}\n\nexport const parseFmt = async ({\n\tstate,\n}: {\n\tstate: ParserState;\n}): Promise<ParseResult> => {\n\tconst {iterator} = state;\n\tconst ckSize = iterator.getUint32Le(); // chunkSize\n\tconst box = iterator.startBox(ckSize);\n\tconst audioFormat = iterator.getUint16Le();\n\tif (audioFormat !== 1 && audioFormat !== 65534) {\n\t\tthrow new Error(\n\t\t\t`Only supporting WAVE with PCM audio format, but got ${audioFormat}`,\n\t\t);\n\t}\n\n\tconst numberOfChannels = iterator.getUint16Le();\n\tconst sampleRate = iterator.getUint32Le();\n\tconst byteRate = iterator.getUint32Le();\n\tconst blockAlign = iterator.getUint16Le();\n\tconst bitsPerSample = iterator.getUint16Le();\n\n\tconst format =\n\t\tbitsPerSample === 16\n\t\t\t? 'pcm-s16'\n\t\t\t: bitsPerSample === 32\n\t\t\t\t? 'pcm-s32'\n\t\t\t\t: bitsPerSample === 24\n\t\t\t\t\t? 'pcm-s24'\n\t\t\t\t\t: null;","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/wav/parse-fmt.ts#L38-L74","documentation":"parseFmt reads the WAV wFormatTag (uint16 LE) and only accepts 1 (PCM) and 65534 (0xFFFE, WAVE_FORMAT_EXTENSIBLE). Every other format code is rejected because the decoder path only handles uncompressed PCM. The thrown audioFormat value is the raw wFormatTag, which identifies the codec (e.g. 85 = MP3, 2 = MS ADPCM, 17 = IMA ADPCM, 3 = IEEE float outside the extensible wrapper).","triggerScenarios":"parseMedia() on a compressed WAV: MP3-in-WAV (tag 0x55), MS ADPCM (2), IMA ADPCM (17), IEEE float (3) not wrapped in WAVE_FORMAT_EXTENSIBLE, GSM (49), μ-law (7), etc.","commonSituations":"Telephony/voice WAVs (ADPCM); 'WAV' files that are really MP3 inside; legacy Windows Sound Recorder output; proprietary codec exports.","solutions":["Check the format tag with ffprobe (it reports PCM vs the compressed codec).","Transcode to PCM WAV: ffmpeg -i in.wav -c:a pcm_s16le out.wav.","Use Mediabunny, which supports a wider set of audio codecs.","try/catch parseMedia() and report the codec as unsupported."],"exampleFix":"# convert compressed WAV -> PCM WAV\nffmpeg -i in.wav -c:a pcm_s16le -ar 48000 -ac 2 out.wav\n\n// then parse the PCM result\nawait parseMedia({ src: 'out.wav' });","handlingStrategy":"try-catch","validationCode":"// check the wFormatTag before parsing: PCM must be 1 or 65534\n// ffprobe -show_entries stream=codec_name,codec_tag_string in.wav\n// codec_name 'pcm_*' => supported; anything else (mp3, adpcm) => will throw","typeGuard":"const isPcmWav = (codecName: string) => codecName.startsWith('pcm_');","tryCatchPattern":"try {\n  await parseMedia({ src: 'in.wav' });\n} catch (err) {\n  if (err instanceof Error && /PCM audio format/.test(err.message)) {\n    // compressed WAV — transcode to PCM or skip\n  } else throw err;\n}","preventionTips":["Standardize on PCM WAVs (pcm_s16le/pcm_s24le/pcm_s32le) upstream.","Probe the codec with ffprobe before parseMedia().","Use Mediabunny for compressed-WAV support."],"tags":["wav","media-parser","unsupported-format","audio","pcm","codec"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}