Selecting a Voice
Relevant source files
The following files were used as context for generating this wiki page:
The voice-elevenlabs plugin provides robust capabilities for selecting, configuring, and creating voices for text-to-speech (TTS) generation. Users can choose from a set of pre-defined voices, create entirely new custom voices from text descriptions, and manage their voice settings directly within the Claude Code environment. This system is designed to be flexible, allowing for a default voice to be set globally while also enabling voice specification on a case-by-case basis, such as in multi-speaker dialogues.
The core functionality relies on the ElevenLabs API. Voice selection is primarily managed through an environment variable or a dedicated configuration command, /voice-config. The plugin also integrates with ElevenLabs' Voice Design v3 API, enabling users to generate unique AI voices on the fly.
Sources: README.md, commands/voice-config.md, commands/create-voice.md
Listing Available Voices
Before selecting a voice, you can list the ones available to you. The plugin comes with a set of default voices, and you can also fetch a complete list of all voices associated with your ElevenLabs account, including any custom voices you have created.
Sources: commands/voices.md, README.md
Default Voices
A curated list of voices is provided for immediate use. "George" is the default voice if no other configuration is set.
| Voice | ID | Style |
|---|---|---|
| George | JBFqnCBsd6RMkjVDRZzb | Natural male (default) |
| Adam | pNInz6obpgDQGcFmaJgB | Deep male |
| Rachel | 21m00Tcm4TlvDq8ikWAM | Natural female |
| Domi | AZnzlk1XvdvUeBnXmlld | Young female |
Sources: README.md:65-72, commands/voices.md:9-16, commands/voice-config.md:14-18
Fetching All Account Voices
To see all available voices in your ElevenLabs account, including custom ones, you can use the /voices command, which executes a curl request to the ElevenLabs API.
The following diagram illustrates the process of fetching voices from the ElevenLabs API.
Sources: commands/voices.md:25-27
You can execute this command directly to get a JSON output of your voices:
curl -s "https://api.elevenlabs.io/v1/voices" \
-H "xi-api-key: $ELEVENLABS_API_KEY" | jq '.voices[] | {name, voice_id}'
Sources: commands/voices.md:25-27
Configuring the Default Voice
The default voice used by commands like /speak and by the voice assistant agent is determined by a specific configuration. You can set this voice using either an environment variable or the /voice-config command.
Sources: README.md:74, commands/voice-config.md, agents/voice-assistant.md:20
Method 1: Environment Variable
The primary method for setting the default voice is by exporting the ELEVENLABS_VOICE_ID environment variable in your shell configuration file (e.g., ~/.zshrc).
export ELEVENLABS_VOICE_ID="pNInz6obpgDQGcFmaJgB"
This sets the default voice to "Adam". The change will take effect after you source your shell configuration or restart your terminal.
Sources: README.md:74-77, commands/voices.md:19-22
Method 2: The /voice-config Command
For a more interactive approach, the /voice-config command allows you to view and change voice settings.
| Action | Description |
|---|---|
show | (Default) Displays the current voice ID and API key status. |
set-voice [voice_id] | Changes the default voice to the one specified by [voice_id]. |
test | Plays a test message using the currently configured voice. |
Sources: commands/voice-config.md:9-21
To change the voice to "Rachel", you would run:
/voice-config set-voice 21m00Tcm4TlvDq8ikWAM
This command updates the voice ID in the plugin's configuration.
The following flowchart shows the logic for managing voice configuration.
Sources: commands/voice-config.md:23-27
Creating Custom Voices
The plugin integrates with ElevenLabs' Voice Design v3, allowing you to create new, unique AI voices from a text description without needing any audio samples. This is done using the /create-voice command.
The process involves:
- Describing the desired voice using natural language (age, gender, accent, tone).
- The system generates 3 voice candidates based on the description.
- You can preview the options and select your favorite.
- The selected voice is saved to your ElevenLabs account and its new voice ID is returned for future use.
Sources: commands/create-voice.md:6-12, commands/create-voice.md:36-41
This diagram illustrates the custom voice creation workflow.
Sources: commands/create-voice.md:36-41
Example command to create a new voice:
/create-voice "middle-aged New Yorker with rising intonation and a half-smile in his voice, like a friendly cab driver telling stories"
Sources: commands/create-voice.md:29-31
Voice Assignment in Specific Commands
While a default voice is used for most operations, some commands offer more granular control over voice selection.
Multi-Speaker Dialogue
The /dialogue command can generate conversations with multiple speakers. Voice assignment follows these rules:
- The first speaker in the script uses your configured default voice.
- Additional speakers are automatically assigned complementary voices by ElevenLabs.
- You can explicitly assign a voice to any speaker in the script using the format
SpeakerName (voice: VoiceNameOrID).
Example of explicit voice assignment:
Alice (voice: Rachel): Hello!
Bob (voice: Adam): Hi there!
This gives you precise control over the voices used in a generated conversation.
Sources: commands/dialogue.md:27-34
Summary
The voice-elevenlabs plugin offers a comprehensive suite for voice selection and management. Users can easily switch between high-quality default voices, list all voices from their account, and configure a default voice through either environment variables or a dedicated command. The integration of ElevenLabs Voice Design v3 via the /create-voice command provides powerful customization, allowing for the creation of unique voices from simple text prompts. This flexibility ensures that users can tailor the auditory feedback of the assistant to their specific needs and preferences.
Sources: README.md, commands/voice-config.md, commands/create-voice.md