Zackriya-Solutions/meetily · error
Failed to create decoder: {}
Error message
Failed to create decoder: {} What it means
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.
Source
Thrown at frontend/src-tauri/src/audio/decoder.rs:476
.codec_params
.sample_rate
.ok_or_else(|| anyhow!("Unknown sample rate"))?;
let mut channels = track
.codec_params
.channels
.map(|c| c.count() as u16)
.unwrap_or(1);
debug!(
"Audio track: {}Hz, {} channels (from metadata)",
sample_rate, channels
);
// Create the decoder
let mut decoder = symphonia::default::get_codecs()
.make(&track.codec_params, &DecoderOptions::default())
.map_err(|e| anyhow!("Failed to create decoder: {}", e))?;
// Decode all packets
let mut all_samples: Vec<f32> = Vec::new();
let mut sample_buf: Option<SampleBuffer<f32>> = None;
// Calculate expected samples for progress tracking
let expected_duration = track.codec_params.n_frames
.map(|frames| frames as f64 / sample_rate as f64);
let expected_samples = expected_duration
.map(|dur| (dur * sample_rate as f64 * channels as f64) as usize);
let mut last_progress = 0u32;
loop {
// Get the next packet
let packet = match format.next_packet() {
Ok(packet) => packet,
Err(symphonia::core::errors::Error::IoError(ref e))View on GitHub (pinned to 0281737d87)
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).
Example fix
// before
let mut decoder = symphonia::default::get_codecs()
.make(&track.codec_params, &DecoderOptions::default())
.map_err(|e| anyhow!("Failed to create decoder: {}", e))?;
// after — unsupported codecs fall back to ffmpeg conversion instead of failing
let mut decoder = match symphonia::default::get_codecs()
.make(&track.codec_params, &DecoderOptions::default())
{
Ok(d) => d,
Err(_) => {
let temp = convert_to_wav_with_ffmpeg(path, progress_callback.as_ref())?;
return decode_wav(temp.to_path_buf(), progress_callback);
}
}; Defensive patterns
Strategy: fallback
Try / catch
// on 'Failed to create decoder', route the file through convert_to_wav_with_ffmpeg (PCM bypasses Symphonia codecs) instead of failing the import
Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Default-feature builds of symphonia (common when trimming compile time/features), older symphonia versions, unusual encoder outputs.
Related errors
- Failed to probe audio format: {}
- Unknown sample rate
- Decode task join error: {}
- FFmpeg not found. FFmpeg is required to decode .{} files. It
- No audio track found in file
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/c2f1d10acfb21f7b.
Report an issue: GitHub.