{"record":{"id":"314f1feeec79f472","repo":"microsoft/VibeVoice","slug":"unsupported-file-format-file-ext-supported-for","errorCode":null,"errorMessage":"Unsupported file format: {file_ext}. Supported formats: .wav, .mp3, .flac, .m4a, .ogg, .pt, .npy, .npz","messagePattern":"Unsupported file format: (.+?)\\. Supported formats: \\.wav, \\.mp3, \\.flac, \\.m4a, \\.ogg, \\.pt, \\.npy, \\.npz","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vibevoice/processor/vibevoice_tokenizer_processor.py","lineNumber":236,"sourceCode":"                audio_path, \n                sr=self.sampling_rate, \n                mono=True\n            )\n            return audio_array\n        elif file_ext == '.pt':\n            # PyTorch tensor file\n            audio_tensor = torch.load(audio_path, map_location='cpu', weights_only=True).squeeze()\n            if isinstance(audio_tensor, torch.Tensor):\n                audio_array = audio_tensor.numpy()\n            else:\n                audio_array = np.array(audio_tensor)\n            return audio_array.astype(np.float32)\n        elif file_ext == '.npy':\n            # NumPy file\n            audio_array = np.load(audio_path)\n            return audio_array.astype(np.float32)\n        else:\n            raise ValueError(\n                f\"Unsupported file format: {file_ext}. \"\n                f\"Supported formats: .wav, .mp3, .flac, .m4a, .ogg, .pt, .npy, .npz\"\n            )\n    \n    def preprocess_audio(\n        self, \n        audio_path_or_array: Union[str, np.ndarray],\n        normalize: Optional[bool] = None,\n    ) -> np.ndarray:\n        \"\"\"\n        Convenience method to preprocess audio from file path or array.\n        This method is kept for backward compatibility but __call__ is recommended.\n        \n        Args:\n            audio_path_or_array: Path to audio file or numpy array\n            normalize: Whether to normalize (overrides default setting)\n            \n        Returns:","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/vibevoice/processor/vibevoice_tokenizer_processor.py#L218-L254","documentation":"_load_audio_from_path dispatches on the file extension: .wav/.mp3/.flac/.m4a/.ogg via ffmpeg, .pt via torch.load, .npy via np.load (the .npz mentioned in the message routes through npz-handling code nearby). An unrecognized extension — .aac, .opus, .wma, .wave, or a path with no extension — raises ValueError rather than guessing a decoder.","triggerScenarios":"Passing '/data/clip.aac', '/data/clip.opus', '/data/clip' (extensionless), or a doubly-dotted path like 'clip.wav.backup' — the final suffix '.backup' is what the extension check sees.","commonSituations":"Voice-clone prompt files exported from phones/browsers (.aac/.opus/.webm); files renamed for versioning; uppercase extensions on case-sensitive filesystems (.WAV) if the extension is lowercased inconsistently.","solutions":["Convert the file to a supported format first: ffmpeg -i clip.aac clip.wav, then pass the .wav path.","Rename files so the true suffix is a supported extension (.wav, .mp3, .flac, .m4a, .ogg, .pt, .npy, .npz).","For extensionless/exotic files, decode to a NumPy array yourself and pass the array instead of the path."],"exampleFix":"# before\nenc = processor(audio='/data/voice_prompt.aac')\n\n# after\nimport subprocess\nsubprocess.run(['ffmpeg', '-y', '-i', '/data/voice_prompt.aac', '/data/voice_prompt.wav'], check=True)\nenc = processor(audio='/data/voice_prompt.wav')","handlingStrategy":"validation","validationCode":"import os\nSUPPORTED = {'.wav', '.mp3', '.flac', '.m4a', '.ogg', '.pt', '.npy', '.npz'}\nif os.path.splitext(path)[1].lower() not in SUPPORTED:\n    raise ValueError(f'convert {path} first: ffmpeg -i {path} out.wav')\nenc = tokenizer_processor(audio=path)","typeGuard":"def is_supported_audio_file(path: str) -> bool:\n    import os\n    return os.path.splitext(path)[1].lower() in {\n        '.wav', '.mp3', '.flac', '.m4a', '.ogg', '.pt', '.npy', '.npz'}","tryCatchPattern":"try:\n    enc = tokenizer_processor(audio=path)\nexcept ValueError as e:\n    if 'Unsupported file format' in str(e):\n        import subprocess, tempfile, os\n        out = tempfile.mktemp(suffix='.wav')\n        subprocess.run(['ffmpeg', '-y', '-i', path, out], check=True,\n                       capture_output=True)\n        enc = tokenizer_processor(audio=out)\n    else:\n        raise","preventionTips":["Check the extension against the supported set before calling.","Normalize all user uploads to .wav during ingestion.","Beware renamed files (.wav.bak) and extensionless paths — the check uses the final suffix only."],"tags":["audio","file-format","ffmpeg","validation"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}