Command: /voices
Relevant source files
The following files were used as context for generating this wiki page:
The /voices command is a utility within the voice-elevenlabs plugin that lists the available text-to-speech voices from ElevenLabs. Its primary purpose is to help users identify which voices can be used for speech synthesis. This command is a key part of the voice configuration workflow, often used before changing the active voice with the /voice-config command or creating a new one with /create-voice.
Sources: README.md:23-27, commands/voices.md:2-3
Functionality
The /voices command is designed to display a list of available ElevenLabs voices. It primarily shows a curated list of default voices but also provides the means to fetch all voices associated with the user's ElevenLabs account. The command itself is executed through a Bash tool.
Sources: commands/voices.md:2-3, commands/voices.md:19-22
Default Voices
The plugin comes with a predefined list of default voices that are immediately available for use. These voices offer a range of styles.
| Voice | ID | Style |
|---|---|---|
| George | JBFqnCBsd6RMkjVDRZzb | Natural male (default) |
| Adam | pNInz6obpgDQGcFmaJgB | Deep male |
| Rachel | 21m00Tcm4TlvDq8ikWAM | Natural female |
| Domi | AZnzlk1XvdvUeBnXmlld | Young female |
Sources: README.md:60-67, commands/voices.md:7-13
Fetching All Account Voices
Users can retrieve a complete list of all voices available in their ElevenLabs account, including custom voices created with /create-voice. This is accomplished by making a direct API call to the ElevenLabs /v1/voices endpoint using curl. The ELEVENLABS_API_KEY environment variable must be set for authentication.
The following diagram illustrates the process of fetching all voices from the user's account.
Sources: commands/voices.md:19-22
The command to perform this action is:
curl -s "https://api.elevenlabs.io/v1/voices" \
-H "xi-api-key: $ELEVENLABS_API_KEY" | jq '.voices[] | {name, voice_id}'
Sources: commands/voices.md:19-22
Voice Configuration and Usage
While /voices lists the available options, the selection and application of a voice are handled by other parts of the plugin ecosystem.
Changing the Voice
To change the active voice for commands like /speak, the user must set the ELEVENLABS_VOICE_ID environment variable. The ID for the desired voice can be found by running the /voices command.
export ELEVENLABS_VOICE_ID="pNInz6obpgDQGcFmaJgB"
The /voice-config command provides a more structured way to manage this setting.
Sources: README.md:69-70, commands/voices.md:15-18, commands/voice-config.md:13-14
Command Inter-relationship
The /voices command is part of a larger workflow for voice generation and management within the plugin. The following diagram shows how /voices relates to other commands.
This diagram shows that voices can be created, listed, configured, and finally used by the speech-generating commands.
Sources: README.md:23-28, commands/create-voice.md:2-3, commands/voices.md:2-3, commands/voice-config.md:2-3, commands/speak.md:2-3
Summary
The /voices command serves as a crucial discovery tool within the voice-elevenlabs plugin. It provides users with the necessary information (Voice IDs) to configure their desired text-to-speech voice. By integrating with the ElevenLabs API, it ensures that users have access to both default and custom-created voices, forming a bridge between voice availability and voice configuration.