remotion-dev/remotion · error · Error

Only supporting WAVE with PCM audio format, but got ${audioF

Error message

Only supporting WAVE with PCM audio format, but got ${audioFormat}

What it means

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).

Source

Thrown at packages/media-parser/src/containers/wav/parse-fmt.ts:56

				channels.push(`Unknown Channel (bit ${bit})`);
			}
		}
	}

	return channels;
}

export const parseFmt = async ({
	state,
}: {
	state: ParserState;
}): Promise<ParseResult> => {
	const {iterator} = state;
	const ckSize = iterator.getUint32Le(); // chunkSize
	const box = iterator.startBox(ckSize);
	const audioFormat = iterator.getUint16Le();
	if (audioFormat !== 1 && audioFormat !== 65534) {
		throw new Error(
			`Only supporting WAVE with PCM audio format, but got ${audioFormat}`,
		);
	}

	const numberOfChannels = iterator.getUint16Le();
	const sampleRate = iterator.getUint32Le();
	const byteRate = iterator.getUint32Le();
	const blockAlign = iterator.getUint16Le();
	const bitsPerSample = iterator.getUint16Le();

	const format =
		bitsPerSample === 16
			? 'pcm-s16'
			: bitsPerSample === 32
				? 'pcm-s32'
				: bitsPerSample === 24
					? 'pcm-s24'
					: null;

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Check the format tag with ffprobe (it reports PCM vs the compressed codec).
  2. Transcode to PCM WAV: ffmpeg -i in.wav -c:a pcm_s16le out.wav.
  3. Use Mediabunny, which supports a wider set of audio codecs.
  4. try/catch parseMedia() and report the codec as unsupported.

Example fix

# convert compressed WAV -> PCM WAV
ffmpeg -i in.wav -c:a pcm_s16le -ar 48000 -ac 2 out.wav

// then parse the PCM result
await parseMedia({ src: 'out.wav' });
Defensive patterns

Strategy: try-catch

Validate before calling

// check the wFormatTag before parsing: PCM must be 1 or 65534
// ffprobe -show_entries stream=codec_name,codec_tag_string in.wav
// codec_name 'pcm_*' => supported; anything else (mp3, adpcm) => will throw

Type guard

const isPcmWav = (codecName: string) => codecName.startsWith('pcm_');

Try / catch

try {
  await parseMedia({ src: 'in.wav' });
} catch (err) {
  if (err instanceof Error && /PCM audio format/.test(err.message)) {
    // compressed WAV — transcode to PCM or skip
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: Telephony/voice WAVs (ADPCM); 'WAV' files that are really MP3 inside; legacy Windows Sound Recorder output; proprietary codec exports.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/84c56b7ee0865837. Report an issue: GitHub.