scholium.voice_manager.VoiceManager#
- class VoiceManager(voices_dir='./voices')[source]#
Bases:
objectManages voice profiles and voice library.
Initialize voice manager.
- Parameters:
voices_dir (
str) – Directory containing voice profiles
Methods
Create a new voice profile.
Load metadata for a voice.
List available voice names.
Load voice configuration for a TTS provider.
Check if a voice exists.
- get_voice_metadata(voice_name)[source]#
Load metadata for a voice.
- Parameters:
voice_name (
str) – Name of the voice- Return type:
- Returns:
Voice metadata dictionary with resolved file paths
- Raises:
FileNotFoundError – If voice doesn’t exist
ValueError – If metadata is invalid
- load_voice(voice_name, provider)[source]#
Load voice configuration for a TTS provider.
- Parameters:
- Return type:
- Returns:
Voice configuration dictionary for the provider. File paths stored in
metadata.yamlare resolved to absolute paths before being returned.- Raises:
ValueError – If voice provider doesn’t match requested provider
- create_voice(voice_name, provider, voice_id=None, model_path=None, config_path=None, description=None, language='en')[source]#
Create a new voice profile.
- Parameters:
voice_name (
str) – Name for the voice.provider (
str) – TTS provider — one of'elevenlabs','coqui','f5tts','styletts2', or'tortoise'.voice_id (
Optional[str]) – ElevenLabs voice ID (required for'elevenlabs').model_path (
Optional[str]) – Path to the reference audio file, stored relative to the voice directory (e.g."sample.wav"). Required for'coqui','f5tts','styletts2', and'tortoise'.config_path (
Optional[str]) – Path to an optional config file (Coqui source-install only), stored relative to the voice directory.description (
Optional[str]) – Human-readable description of the voice.language (
str) – BCP-47 language code (default:'en').
- Return type:
- Returns:
Absolute path to the created voice directory.
- Raises:
ValueError – If required parameters for the provider are missing, or if the provider is not supported.