Zackriya-Solutions/meetily · warning
Unsupported format: .{}. Supported: {}
Error message
Unsupported format: .{}. Supported: {} What it means
validate_audio_file (import.rs:135) rejects the file because its lowercased extension is not in AUDIO_EXTENSIONS (the whitelist from super::constants - mp3/m4a/wav/mp4-class containers plus the ffmpeg-handled mkv/webm/wma set). This is extension-based gating only: the file is never opened first, so a good audio file with an unusual or missing extension is rejected, while a mislabeled file with a whitelisted extension passes this check and fails later in decode.
Source
Thrown at frontend/src-tauri/src/audio/import.rs:135
}
/// Validate an audio file and return its info using metadata-only approach
/// Falls back to full decode if metadata is unavailable
pub fn validate_audio_file(path: &Path) -> Result<AudioFileInfo> {
// Check file exists
if !path.exists() {
return Err(anyhow!("File does not exist: {}", path.display()));
}
// Check extension
let extension = path
.extension()
.and_then(|e| e.to_str())
.map(|e| e.to_lowercase())
.unwrap_or_default();
if !AUDIO_EXTENSIONS.contains(&extension.as_str()) {
return Err(anyhow!(
"Unsupported format: .{}. Supported: {}",
extension,
AUDIO_EXTENSIONS.join(", ")
));
}
// Get file size
let metadata = std::fs::metadata(path)
.map_err(|e| anyhow!("Cannot read file: {}", e))?;
let size_bytes = metadata.len();
// Check file size limit
if size_bytes > MAX_FILE_SIZE_BYTES {
return Err(anyhow!(
"File too large: {:.2}GB. Maximum supported size is {}GB",
size_bytes as f64 / (1024.0 * 1024.0 * 1024.0),
MAX_FILE_SIZE_BYTES / (1024 * 1024 * 1024)
));View on GitHub (pinned to 0281737d87)
Solutions
- Re-encode/wrap into a supported container: ffmpeg -i input.flac -c:a aac output.m4a (or -ar 16000 -ac 1 wav).
- Rename only when the container actually matches a supported codec - renaming .ogg to .mp3 passes this gate then fails in decode.
- If you control the app build, extend AUDIO_EXTENSIONS in audio/constants.rs AND ensure Symphonia or the ffmpeg pre-conversion list in decoder.rs actually supports the codec.
- Pre-filter in the UI dialog (filters list) so unsupported extensions can never be selected.
Example fix
# before: unsupported extension rejected at the gate # (renaming alone is a trap: decode will fail later) # after: transcode to a whitelisted container/codec ffmpeg -i voice-memo.flac -c:a aac -b:a 128k out.m4a # import out.m4a
Defensive patterns
Strategy: validation
Validate before calling
// Frontend: constrain the picker so unsupported extensions cannot be chosen
import { open } from '@tauri-apps/plugin-dialog';
const picked = await open({
filters: [{ name: 'Audio', extensions: ['mp3','m4a','wav','mp4','mkv','webm','wma'] }],
}); Type guard
// TypeScript: mirror the Rust whitelist before invoking
const AUDIO_EXTENSIONS = ['mp3','m4a','wav','mp4','mkv','webm','wma'];
const isSupportedAudioFile = (p: string) =>
AUDIO_EXTENSIONS.includes(p.split('.').pop()?.toLowerCase() ?? ''); Try / catch
// Catch and guide the user to convert, rather than showing a raw error
try { await invoke('validate_audio_file', { path }); }
catch (e) {
if (String(e).startsWith('Unsupported format')) suggestTranscode(e);
else throw e;
} Prevention
- Filter the file dialog to AUDIO_EXTENSIONS.
- Convert FLAC/OGG/OPUS/AAC to m4a/wav with ffmpeg before import.
- Never fix by renaming alone - the extension gate is followed by real decoding.
- If you own the build, extend AUDIO_EXTENSIONS AND the Symphonia/ffmpeg support behind it.
When it happens
Trigger: Passing .flac/.ogg/.opus/.aac/.amr/.aiff files (not on the list); files with no extension at all (extension() is None, unwrap_or_default gives an empty string that never matches); double extensions like .mp4.part or .wav.download during an incomplete transfer; names with a trailing space after the extension.
Common situations: Users importing voice memos in FLAC/OGG/OPUS (common from Android recorders and open-source tools); recordings renamed by cloud sync tools; .m4a exports labeled .aac by some apps; users typing a filename manually.
Related errors
- File does not exist: {}
- File too large: {:.2}GB. Maximum supported size is {}GB
- Cannot read file: {}
- Source file not found: {}
- No transcript text available. Please add some text first.
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/a3582d9097be5929.
Report an issue: GitHub.