Command: /voice-config
Relevant source files
The following files were used as context for generating this wiki page:
The /voice-config command is a utility within the Voice ElevenLabs plugin for managing Text-to-Speech (TTS) settings. It allows users to view their current configuration, change the active voice, and test the setup to ensure it's working correctly. This command is central to personalizing the voice output used by other commands like /speak and agents such as the voice-assistant.
Proper configuration is a prerequisite for the plugin's core functionality, as it relies on a valid ElevenLabs API key and a selected voice ID to generate audio.
Sources: [README.md:19-25](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/README.md#L19-L25), [commands/voice-config.md:1-3](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md#L1-L3), [agents/voice-assistant.md:20](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/agents/voice-assistant.md#L20)
Configuration Elements
The plugin's behavior is controlled by two main environment variables. These must be set up in the user's shell environment (e.g., ~/.zshrc) for the voice features to function.
Sources: [README.md:12-15](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/README.md#L12-L15)
| Variable | Description | Setup Example |
|---|---|---|
ELEVENLABS_API_KEY | Your API key from ElevenLabs. Required for all API interactions. | export ELEVENLABS_API_KEY="your_key_here" |
ELEVENLABS_VOICE_ID | The ID of the ElevenLabs voice to use for TTS. If not set, a default is used. | export ELEVENLABS_VOICE_ID="pNInz6obpgDQGcFmaJgB" |
Sources: [README.md:12-15](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/README.md#L12-L15), [commands/voices.md:18-20](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voices.md#L18-L20)
To set the API key, you can add it to your shell configuration file:
echo 'export ELEVENLABS_API_KEY="your_key_here"' >> ~/.zshrc
source ~/.zshrc
Sources: [README.md:13-14](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/README.md#L13-L14)
Command Actions
The /voice-config command accepts several actions to manage and inspect the configuration. The following diagram illustrates the command's logic based on the provided action.
This diagram shows the flow for the different actions of the /voice-config command.
Sources: [commands/voice-config.md:7-21](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md#L7-L21)
show (default)
This is the default action if no other is specified. It displays the current voice configuration status. The output includes:
- The current voice ID being used.
- The status of the
ELEVENLABS_API_KEY(e.g., "configured" or "not configured"). - A list of available voices.
Sources: [commands/voice-config.md:8-11](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md#L8-L11), [commands/voice-config.md:18-19](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md#L18-L19)
set-voice [voice_id]
This action changes the default voice used for TTS generation. It requires a voice_id as an argument. For a persistent change, the ELEVENLABS_VOICE_ID environment variable should be set.
Sources: [commands/voice-config.md:12](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md#L12), [commands/voices.md:16-20](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voices.md#L16-L20)
Popular Voice Options:
| Voice Name | Voice ID | Description |
|---|---|---|
| George | JBFqnCBsd6RMkjVDRZzb | Natural male (default) |
| Adam | pNInz6obpgDQGcFmaJgB | Deep male |
| Rachel | 21m00Tcm4TlvDq8ikWAM | Natural female |
| Domi | AZnzlk1XvdvUeBnXmlld | Young female |
Sources: [commands/voice-config.md:13-17](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md#L13-L17), [commands/voices.md:8-14](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voices.md#L8-L14)
To see all voices available on your account, you can use the /voices command or run the following API call:
curl -s "https://api.elevenlabs.io/v1/voices" \
-H "xi-api-key: $ELEVENLABS_API_KEY" | jq '.voices[] | {name, voice_id}'
Sources: [commands/voices.md:22-25](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voices.md#L22-L25)
test
This action plays a test message using the current voice and API key settings to confirm that the configuration is working correctly. The spoken message is: "Voice configuration is working correctly".
Sources: [commands/voice-config.md:19-21](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md#L19-L21)
The following sequence diagram illustrates the process for the test action.
This diagram shows how the test command uses the configured API key and voice ID to request speech from the ElevenLabs API and play it back.
Sources: [commands/voice-config.md:19-21](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md#L19-L21), [commands/speak.md:23-28](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/speak.md#L23-L28)
Summary
The /voice-config command serves as the primary control panel for the ElevenLabs voice integration. It provides essential functions for viewing, changing, and verifying voice settings. By using its show, set-voice, and test actions, users can ensure their API key is correctly installed and select their preferred voice, which is then used by all other voice-related features like the voice-assistant agent and the /speak command.
Sources: [commands/voice-config.md](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/commands/voice-config.md), [agents/voice-assistant.md:20](https://github.com/adamanz/voice-elevenlabs/blob/HEAD/agents/voice-assistant.md#L20)