{"record":{"id":"b81d7671f77351ac","repo":"Zackriya-Solutions/meetily","slug":"unknown-sample-rate","errorCode":null,"errorMessage":"Unknown sample rate","messagePattern":"Unknown sample rate","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/decoder.rs","lineNumber":460,"sourceCode":"        )\n        .map_err(|e| anyhow!(\"Failed to probe audio format: {}\", e))?;\n\n    let mut format = probed.format;\n\n    // Find the first audio track\n    let track = format\n        .tracks()\n        .iter()\n        .find(|t| t.codec_params.codec != CODEC_TYPE_NULL)\n        .ok_or_else(|| anyhow!(\"No audio track found in file\"))?;\n\n    let track_id = track.id;\n\n    // Get audio parameters\n    let sample_rate = track\n        .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","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/decoder.rs#L442-L478","documentation":"The selected track's codec_params.sample_rate was None, so the decoder cannot proceed — the resampler and duration/progress math (frames / rate further down) all need it. Some containers and raw formats don't carry a sample rate in their headers (raw PCM, hand-muxed or exotic files). Standard WAV/FLAC/M4A exports essentially never hit this; it's a signature of unusual or hand-built media.","triggerScenarios":"Importing raw PCM with no header, files muxed by niche tools that omit the rate, or stream dumps where parameters weren't captured.","commonSituations":"Recordings converted with custom pipelines, radio capture dumps, files produced by research tooling.","solutions":["Convert the file to WAV first (`ffmpeg -i input out.wav`) — WAV headers always declare the rate.","If you produce these files yourself, mux into a standard container that writes the sample rate.","Code fix: fall back to ffmpeg conversion when sample_rate is None (see exampleFix)."],"exampleFix":"// before\nlet sample_rate = track.codec_params.sample_rate\n    .ok_or_else(|| anyhow!(\"Unknown sample rate\"))?;\n\n// after — route to ffmpeg conversion, whose WAV output always carries the rate\nlet sample_rate = match track.codec_params.sample_rate {\n    Some(sr) => sr,\n    None => {\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 'Unknown sample rate', fall back to convert_to_wav_with_ffmpeg — WAV headers always declare the rate — then decode the WAV","preventionTips":["Prefer standard containers (WAV/FLAC/M4A) for archival recordings.","When muxing custom files, always write the sample rate into the container."],"tags":["symphonia","sample-rate","metadata","audio-decode"],"backgroundTag":"missing-audio-metadata","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}