microsoft/VibeVoice · error · ValueError

Multiple voice presets match the speaker name '{speaker_name

Error message

Multiple voice presets match the speaker name '{speaker_name}', please make the speaker_name more specific.

What it means

Raised by VoicePresetManager.get_voice_path in the demo script when the requested speaker name does not exactly match a preset key but partially matches two or more preset names. The partial matcher loops over self.voice_presets and requires exactly one bidirectional substring match; two or more matches is ambiguous and aborts with ValueError. For example 'man' matches 'en-Carter_man', 'en-Davis_man', 'en-Mike_man', etc.

Source

Thrown at demo/realtime_model_inference_from_file.py:77

            if os.path.exists(path)
        }
        
        print(f"Found {len(self.available_voices)} voice files in {voices_dir}")
        print(f"Available voices: {', '.join(self.available_voices.keys())}")

    def get_voice_path(self, speaker_name: str) -> str:
        """Get voice file path for a given speaker name"""
        # First try exact match
        speaker_name = speaker_name.lower()
        if speaker_name in self.voice_presets:
            return self.voice_presets[speaker_name]
        
        # Try partial matching (case insensitive)
        matched_path = None
        for preset_name, path in self.voice_presets.items():
            if preset_name.lower() in speaker_name or speaker_name in preset_name.lower():
                if matched_path is not None:
                    raise ValueError(f"Multiple voice presets match the speaker name '{speaker_name}', please make the speaker_name more specific.")
                matched_path = path
        if matched_path is not None:
            return matched_path
        
        # Default to first voice if no match found
        default_voice = list(self.voice_presets.values())[0]
        print(f"Warning: No voice preset found for '{speaker_name}', using default voice: {default_voice}")
        return default_voice


def parse_args():
    parser = argparse.ArgumentParser(description="VibeVoiceStreaming Processor TXT Input Test")
    parser.add_argument(
        "--model_path",
        type=str,
        default="microsoft/VibeVoice-Realtime-0.5B",
        help="Path to the HuggingFace model directory",
    )

View on GitHub (pinned to 94da20d98b)

Solutions

  1. Pass the full preset name exactly, e.g. 'en-Carter_man' (keys are the .pt file stems in demo/voices/streaming_model).
  2. Add enough of the name to be unique, e.g. 'carter' or 'en-Carter' instead of 'man'.
  3. List available presets (print the voice_presets dict) and pick a unique key before calling.
  4. If programmatic use is required, wrap the call in try/except ValueError and fall back to an explicit default key.

Example fix

// before
path = manager.get_voice_path("man")  # ambiguous: matches Carter/Davis/Mike

// after
path = manager.get_voice_path("en-Carter_man")  # exact, unique key
Defensive patterns

Strategy: validation

Validate before calling

def safe_get_voice_path(manager, speaker_name: str) -> str:
    name = speaker_name.lower()
    if name in manager.voice_presets:
        return manager.voice_presets[name]
    matches = [p for p in manager.voice_presets if p.lower() in name or name in p.lower()]
    if len(matches) == 1:
        return manager.voice_presets[matches[0]]
    raise KeyError(f"Ambiguous/non-unique speaker {speaker_name!r}; candidates: {matches}")

Try / catch

try:
    path = manager.get_voice_path(speaker)
except ValueError as e:
    # e lists the ambiguity; pick explicitly from manager.voice_presets
    print(sorted(manager.voice_presets))
    path = manager.voice_presets["en-Carter_man"]

Prevention

When it happens

Trigger: Calling get_voice_path('man'), get_voice_path('e'), or any substring contained in multiple preset names (preset names like en-Carter_man, en-Davis_man, en-Emma_woman). Exact matches (e.g. 'en-Carter_man') never trigger it; only ambiguous partial matches do.

Common situations: User passes a loose speaker name like 'en' or 'woman' to the demo CLI; voices directory contains many similarly named presets (de-Spk0_man, fr-Spk0_man ...); case differences do not help because matching is already case-insensitive.

Related errors


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