{"record":{"id":"c2f1d10acfb21f7b","repo":"Zackriya-Solutions/meetily","slug":"failed-to-create-decoder","errorCode":null,"errorMessage":"Failed to create decoder: {}","messagePattern":"Failed to create decoder: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/decoder.rs","lineNumber":476,"sourceCode":"        .codec_params\n        .sample_rate\n        .ok_or_else(|| anyhow!(\"Unknown sample rate\"))?;\n\n    let mut channels = track\n        .codec_params\n        .channels\n        .map(|c| c.count() as u16)\n        .unwrap_or(1);\n\n    debug!(\n        \"Audio track: {}Hz, {} channels (from metadata)\",\n        sample_rate, channels\n    );\n\n    // Create the decoder\n    let mut decoder = symphonia::default::get_codecs()\n        .make(&track.codec_params, &DecoderOptions::default())\n        .map_err(|e| anyhow!(\"Failed to create decoder: {}\", e))?;\n\n    // Decode all packets\n    let mut all_samples: Vec<f32> = Vec::new();\n    let mut sample_buf: Option<SampleBuffer<f32>> = None;\n\n    // Calculate expected samples for progress tracking\n    let expected_duration = track.codec_params.n_frames\n        .map(|frames| frames as f64 / sample_rate as f64);\n    let expected_samples = expected_duration\n        .map(|dur| (dur * sample_rate as f64 * channels as f64) as usize);\n\n    let mut last_progress = 0u32;\n\n    loop {\n        // Get the next packet\n        let packet = match format.next_packet() {\n            Ok(packet) => packet,\n            Err(symphonia::core::errors::Error::IoError(ref e))","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/decoder.rs#L458-L494","documentation":"Symphonia recognized the track (probe succeeded, sample rate present) but get_codecs().make() refused to build a decoder — the codec is known but not enabled in the compiled symphonia default feature set (e.g. AAC/ALAC behind cargo features), or the codec parameters are malformed for the registered implementation. The media itself is usually fine; the build just lacks codec support, and ffmpeg conversion is the escape hatch.","triggerScenarios":"Importing AAC/ALAC files into a build where the corresponding symphonia cargo features are disabled; codec variants the bundled symphonia version doesn't register; malformed codec init data in the header.","commonSituations":"Default-feature builds of symphonia (common when trimming compile time/features), older symphonia versions, unusual encoder outputs.","solutions":["Convert the file to WAV/PCM via ffmpeg before import — PCM bypasses Symphonia codecs entirely.","If you control the build, enable the required symphonia cargo features (aac, alac, isomp4, ...) and rebuild.","Update the symphonia dependency — newer versions register more codecs in the default set.","Code fix: route decoder-creation failure into the ffmpeg conversion path as a fallback (see exampleFix)."],"exampleFix":"// before\nlet mut decoder = symphonia::default::get_codecs()\n    .make(&track.codec_params, &DecoderOptions::default())\n    .map_err(|e| anyhow!(\"Failed to create decoder: {}\", e))?;\n\n// after — unsupported codecs fall back to ffmpeg conversion instead of failing\nlet mut decoder = match symphonia::default::get_codecs()\n    .make(&track.codec_params, &DecoderOptions::default())\n{\n    Ok(d) => d,\n    Err(_) => {\n        let temp = convert_to_wav_with_ffmpeg(path, progress_callback.as_ref())?;\n        return decode_wav(temp.to_path_buf(), progress_callback);\n    }\n};","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// on 'Failed to create decoder', route the file through convert_to_wav_with_ffmpeg (PCM bypasses Symphonia codecs) instead of failing the import","preventionTips":["Enable required symphonia cargo features (aac, alac, isomp4, ...) if you control the build.","Keep the ffmpeg fallback reachable for every probe-success/decoder-failure combination.","Test a format corpus (aac, alac, ogg-opus, flac, wav, mp3) each release."],"tags":["symphonia","unsupported-codec","cargo-features","audio-decode"],"backgroundTag":"unsupported-audio-codec","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}