scholium.voice_manager.VoiceManager#

class VoiceManager(voices_dir='./voices')[source]#

Bases: object

Manages voice profiles and voice library.

Initialize voice manager.

Parameters:

voices_dir (str) – Directory containing voice profiles

Methods

create_voice

Create a new voice profile.

get_voice_metadata

Load metadata for a voice.

list_voices

List available voice names.

load_voice

Load voice configuration for a TTS provider.

voice_exists

Check if a voice exists.

list_voices()[source]#

List available voice names.

Return type:

List[str]

Returns:

List of voice names

get_voice_metadata(voice_name)[source]#

Load metadata for a voice.

Parameters:

voice_name (str) – Name of the voice

Return type:

Dict[str, Any]

Returns:

Voice metadata dictionary with resolved file paths

Raises:
load_voice(voice_name, provider)[source]#

Load voice configuration for a TTS provider.

Parameters:
  • voice_name (str) – Name of the voice

  • provider (str) – TTS provider ('elevenlabs', 'coqui', 'f5tts', 'styletts2', or 'tortoise')

Return type:

Dict[str, Any]

Returns:

Voice configuration dictionary for the provider. File paths stored in metadata.yaml are 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:

str

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.

voice_exists(voice_name)[source]#

Check if a voice exists.

Parameters:

voice_name (str) – Name of the voice

Return type:

bool

Returns:

True if voice exists, False otherwise