microsoft/VibeVoice · error · ValueError

Unsupported file format: {file_ext}. Supported formats: .wav

Error message

Unsupported file format: {file_ext}. Supported formats: .wav, .mp3, .flac, .m4a, .ogg, .pt, .npy, .npz

What it means

_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.

Source

Thrown at vibevoice/processor/vibevoice_tokenizer_processor.py:236

                audio_path, 
                sr=self.sampling_rate, 
                mono=True
            )
            return audio_array
        elif file_ext == '.pt':
            # PyTorch tensor file
            audio_tensor = torch.load(audio_path, map_location='cpu', weights_only=True).squeeze()
            if isinstance(audio_tensor, torch.Tensor):
                audio_array = audio_tensor.numpy()
            else:
                audio_array = np.array(audio_tensor)
            return audio_array.astype(np.float32)
        elif file_ext == '.npy':
            # NumPy file
            audio_array = np.load(audio_path)
            return audio_array.astype(np.float32)
        else:
            raise ValueError(
                f"Unsupported file format: {file_ext}. "
                f"Supported formats: .wav, .mp3, .flac, .m4a, .ogg, .pt, .npy, .npz"
            )
    
    def preprocess_audio(
        self, 
        audio_path_or_array: Union[str, np.ndarray],
        normalize: Optional[bool] = None,
    ) -> np.ndarray:
        """
        Convenience method to preprocess audio from file path or array.
        This method is kept for backward compatibility but __call__ is recommended.
        
        Args:
            audio_path_or_array: Path to audio file or numpy array
            normalize: Whether to normalize (overrides default setting)
            
        Returns:

View on GitHub (pinned to 94da20d98b)

Solutions

  1. Convert the file to a supported format first: ffmpeg -i clip.aac clip.wav, then pass the .wav path.
  2. Rename files so the true suffix is a supported extension (.wav, .mp3, .flac, .m4a, .ogg, .pt, .npy, .npz).
  3. For extensionless/exotic files, decode to a NumPy array yourself and pass the array instead of the path.

Example fix

# before
enc = processor(audio='/data/voice_prompt.aac')

# after
import subprocess
subprocess.run(['ffmpeg', '-y', '-i', '/data/voice_prompt.aac', '/data/voice_prompt.wav'], check=True)
enc = processor(audio='/data/voice_prompt.wav')
Defensive patterns

Strategy: validation

Validate before calling

import os
SUPPORTED = {'.wav', '.mp3', '.flac', '.m4a', '.ogg', '.pt', '.npy', '.npz'}
if os.path.splitext(path)[1].lower() not in SUPPORTED:
    raise ValueError(f'convert {path} first: ffmpeg -i {path} out.wav')
enc = tokenizer_processor(audio=path)

Type guard

def is_supported_audio_file(path: str) -> bool:
    import os
    return os.path.splitext(path)[1].lower() in {
        '.wav', '.mp3', '.flac', '.m4a', '.ogg', '.pt', '.npy', '.npz'}

Try / catch

try:
    enc = tokenizer_processor(audio=path)
except ValueError as e:
    if 'Unsupported file format' in str(e):
        import subprocess, tempfile, os
        out = tempfile.mktemp(suffix='.wav')
        subprocess.run(['ffmpeg', '-y', '-i', path, out], check=True,
                       capture_output=True)
        enc = tokenizer_processor(audio=out)
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15). Data as JSON: /api/errors/314f1feeec79f472. Report an issue: GitHub.