Zackriya-Solutions/meetily · error
Failed to probe audio format: {}
Error message
Failed to probe audio format: {} What it means
Symphonia's probe could not identify a supported container/codec from the MediaSourceStream plus the Hint built from the file extension. The extension hint can actively mislead: a renamed file (e.g. Opus-in-Ogg named .mp3) makes the prober expect the wrong format. Other causes are truncated headers after interrupted transfers and containers outside Symphonia's compiled default feature set. Note this path is only reached for extensions Symphonia claims to handle — genuinely foreign extensions went through ffmpeg first.
Source
Thrown at frontend/src-tauri/src/audio/decoder.rs:443
.map_err(|e| anyhow!("Failed to open audio file '{}': {}", decode_path.display(), e))?;
let mss = MediaSourceStream::new(Box::new(file), Default::default());
// Set up format hint based on file extension
let mut hint = Hint::new();
if let Some(ext) = decode_path.extension().and_then(|e| e.to_str()) {
hint.with_extension(ext);
}
// Probe the file format
let probed = symphonia::default::get_probe()
.format(
&hint,
mss,
&FormatOptions::default(),
&MetadataOptions::default(),
)
.map_err(|e| anyhow!("Failed to probe audio format: {}", e))?;
let mut format = probed.format;
// Find the first audio track
let track = format
.tracks()
.iter()
.find(|t| t.codec_params.codec != CODEC_TYPE_NULL)
.ok_or_else(|| anyhow!("No audio track found in file"))?;
let track_id = track.id;
// Get audio parameters
let sample_rate = track
.codec_params
.sample_rate
.ok_or_else(|| anyhow!("Unknown sample rate"))?;
View on GitHub (pinned to 0281737d87)
Solutions
- Verify the file's real format with `ffprobe <file>` or a player — renaming between extensions breaks the extension Hint.
- Rename the file to its true extension, or convert it to .wav/.m4a with ffmpeg before importing.
- Code fix: on probe failure, retry with an empty Hint (no extension) so Symphonia sniffs the actual bytes (see exampleFix).
- If a specific container matters to your users, enable the corresponding symphonia cargo feature.
Example fix
// before
let probed = symphonia::default::get_probe()
.format(&hint, mss, &FormatOptions::default(), &MetadataOptions::default())
.map_err(|e| anyhow!("Failed to probe audio format: {}", e))?;
// after — retry without the (possibly wrong) extension hint
let probed = match symphonia::default::get_probe()
.format(&hint, mss, &FormatOptions::default(), &MetadataOptions::default())
{
Ok(p) => p,
Err(_) => {
let file = std::fs::File::open(decode_path.as_ref())?;
let mss2 = MediaSourceStream::new(Box::new(file), Default::default());
symphonia::default::get_probe()
.format(&Hint::new(), mss2, &FormatOptions::default(), &MetadataOptions::default())
.map_err(|e| anyhow!("Failed to probe audio format: {}", e))?
}
}; Defensive patterns
Strategy: fallback
Validate before calling
// trust content, not the filename: sniff magic bytes before setting the Hint let mut magic = [0u8; 12]; let mut f = std::fs::File::open(&decode_path)?; std::io::Read::read_exact(&mut f, &mut magic)?; // map magic (e.g. 'OggS', 'RIFF', 'fLaC') to the extension used for the Hint
Try / catch
// on probe failure: retry once with an empty Hint (drop the extension) so Symphonia sniffs the real container; if that also fails, offer ffmpeg conversion to WAV
Prevention
- Never rename audio files to a different extension.
- When exporting from other tools, prefer WAV/FLAC/M4A.
- Treat probe failure as a routing signal to the ffmpeg path, not a dead end.
When it happens
Trigger: File extension doesn't match actual content (manual rename); header truncated by an interrupted copy/download; a container that requires a cargo feature not enabled in the build; empty or tiny garbage files.
Common situations: Files renamed for organization, re-uploaded downloads that got cut off, odd muxer outputs from niche tools.
Related errors
- Unknown sample rate
- Failed to create decoder: {}
- 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/b08d71945a5c65d8.
Report an issue: GitHub.