{"record":{"id":"49eb292c05f3996d","repo":"remotion-dev/remotion","slug":"the-audio-track-cannot-be-decoded-in-this-browser","errorCode":null,"errorMessage":"The audio track cannot be decoded in this browser. Try converting the media to WAV first.","messagePattern":"The audio track cannot be decoded in this browser\\. Try converting the media to WAV first\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/Transcription/resample-media-to-16-khz.ts","lineNumber":90,"sourceCode":"\t\t\t\t\t\t\t\tFloat32Array.BYTES_PER_ELEMENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsample.copyTo(floats, {format: 'f32', planeIndex: 0});\n\t\t\t\t\t\twaveformChunks.push({\n\t\t\t\t\t\t\tstartFrame: Math.round(\n\t\t\t\t\t\t\t\tsample.timestamp * WHISPER_WEBGPU_SAMPLE_RATE,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\twaveform: floats,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn sample;\n\t\t\t\t\t},\n\t\t\t\t\tsampleFormat: 'f32',\n\t\t\t\t\tsampleRate: WHISPER_WEBGPU_SAMPLE_RATE,\n\t\t\t\t};\n\t\t\t},\n\t\t});\n\n\t\tif (!conversion.isValid) {\n\t\t\tthrow new Error(\n\t\t\t\t'The audio track cannot be decoded in this browser. Try converting the media to WAV first.',\n\t\t\t);\n\t\t}\n\n\t\tconversion.onProgress = (progress) => onProgress(progress);\n\t\tawait conversion.execute();\n\t\tonProgress(1);\n\t} finally {\n\t\tinput.dispose();\n\t}\n\n\tconst waveformLength = waveformChunks.reduce(\n\t\t(maximum, chunk) =>\n\t\t\tMath.max(maximum, chunk.startFrame + chunk.waveform.length),\n\t\t0,\n\t);\n\tconst waveform = new Float32Array(waveformLength);\n\tfor (const chunk of waveformChunks) {","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/Transcription/resample-media-to-16-khz.ts#L72-L108","documentation":"After Mediabunny conversion setup, the code checks conversion.isValid. If false, the browser's WebCodecs stack could not decode the audio track (unsupported codec or decoder unavailable), so transcription aborts and suggests converting the media to WAV first.","triggerScenarios":"Calling resampleMediaTo16Khz on media whose audio codec is not decodable in the current browser — e.g. EAC3, AC3, Opus in a container the browser can't demux, or a browser without the needed AudioDecoder support.","commonSituations":"Safari/Chrome codec gaps (e.g. DTS/EAC3 audio in MKV/MP4); older browsers lacking WebCodecs; browser without GPU/WebGPU Whisper prerequisites where fallback decode fails.","solutions":["Convert the media to WAV (e.g. `ffmpeg -i input.mp4 -vn -ac 1 -ar 16000 output.wav`) and use that as the source.","Use a media file with a widely supported audio codec (AAC, MP3, Opus in a supported container).","Try a different browser (typically Chrome) that supports the source codec via WebCodecs.","Update the browser to the latest version for broader codec support."],"exampleFix":"// before\naddCaptionJob({src: 'movie.mkv'}); // EAC3 audio, not decodable\n// after\n// ffmpeg -i movie.mkv -vn -ac 1 -ar 16000 movie.wav\naddCaptionJob({src: '/assets/movie.wav'});","handlingStrategy":"fallback","validationCode":"if (typeof AudioDecoder === 'undefined') {\n  console.warn('WebCodecs AudioDecoder unavailable; convert media to WAV first.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await transcribe(src);\n} catch (e) {\n  if (e.message.includes('cannot be decoded in this browser')) {\n    promptUserToConvertToWav(src);\n  }\n}","preventionTips":["Prefer WAV/AAC/MP3/Opus audio sources.","Provide an ffmpeg-based WAV conversion step.","Test codec support in target browsers (Chrome best for WebCodecs)."],"tags":["audio","codec","browser-compatibility","transcription"],"backgroundTag":"unsupported-dtype","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}