{"record":{"id":"da2ffee1e0fbfc1e","repo":"remotion-dev/remotion","slug":"unsupported-subformat-subformat","errorCode":null,"errorMessage":"Unsupported subformat: ${subFormat}","messagePattern":"Unsupported subformat: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/wav/parse-fmt.ts","lineNumber":113,"sourceCode":"\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: {\n\t\t\ttype: 'audio',\n\t\t\tcodec: format,\n\t\t\tcodecData: null,\n\t\t\tdescription: undefined,\n\t\t\tcodecEnum: format,\n\t\t\tnumberOfChannels,\n\t\t\tsampleRate,\n\t\t\toriginalTimescale: 1_000_000,\n\t\t\ttrackId: 0,\n\t\t\tstartInSeconds: 0,","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/wav/parse-fmt.ts#L95-L131","documentation":"For EXTENSIBLE WAVs the 16-byte subFormat GUID is tested against the PCM GUID and the IEEE-float GUID (subformatIsPcm / subformatIsIeeeFloat). If it matches neither, the parser does not know how to decode the samples and throws the raw GUID bytes. Only PCM and IEEE-float subtypes are modeled.","triggerScenarios":"A WAVE_FORMAT_EXTENSIBLE WAV whose subFormat GUID is neither KSDATAFORMAT_SUBTYPE_PCM nor the IEEE-float subtype — e.g. ADPCM, A-law, μ-law, WMA, or another codec wrapped in the EXTENSIBLE format.","commonSituations":"Compressed audio wrapped in WAVE_FORMAT_EXTENSIBLE; proprietary/legacy codec GUIDs; DAW exports of unusual codecs.","solutions":["Identify the underlying codec with ffprobe.","Re-encode to PCM: ffmpeg -i in.wav -c:a pcm_s16le out.wav.","Use Mediabunny for wider GUID/codec handling.","try/catch parseMedia() and skip the file."],"exampleFix":"# unknown subFormat GUID -> PCM\nffmpeg -i in.wav -c:a pcm_s16le out.wav\n\nawait parseMedia({ src: 'out.wav' });","handlingStrategy":"try-catch","validationCode":"// confirm the subFormat is PCM or IEEE float via ffprobe codec_name\n// ffprobe -show_entries stream=codec_name in.wav","typeGuard":"const SUPPORTED_SUBFORMATS = new Set(['pcm_s16le','pcm_s24le','pcm_s32le','pcm_f32le']);\nconst isSupportedSubformat = (codec: string) => SUPPORTED_SUBFORMATS.has(codec);","tryCatchPattern":"try {\n  await parseMedia({ src: 'in.wav' });\n} catch (err) {\n  if (err instanceof Error && /Unsupported subformat/i.test(err.message)) {\n    // unknown GUID — re-encode to PCM or skip\n  } else throw err;\n}","preventionTips":["Avoid wrapping non-PCM codecs in WAVE_FORMAT_EXTENSIBLE.","Probe codec_name before parsing.","Use Mediabunny for broader GUID handling."],"tags":["wav","media-parser","unsupported-format","audio","codec"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}