In this guide, we’ll explore how to experiment with different voices online and implement voice switching in your voice bot. We’ll cover two popular text-to-speech (TTS) services: ElevenLabs and Cartesia TTS.

ElevenLabs

ElevenLabs offers a wide range of high-quality voices that you can try out and customize.

Trying Out Voices Online

  1. Visit the ElevenLabs Voice Library.
  2. Browse through the available voices or use the search function to find specific types of voices.
  3. Click on a voice to hear a sample.
  4. Copy the voice ID, which you’ll need for the next step.

Switching Voices in voice_bot.py

To switch voices in your voice bot, you’ll need to modify the voice_id parameter when initializing the ElevenLabsTTS node. Here’s how to do it:

import outspeed as sp

@sp.App()
class VoiceBot:
    async def setup(self) -> None:
        """
        Initialize the VoiceBot.
        """
        # ... existing code ...
        self.tts_node = sp.ElevenLabsTTS(
            voice_id="your_voice_id_here",   # Update this line
            model="eleven_multilingual_v2",  # Update the model
            volume=0.7,                      # Update the volume
            stability=0.7,                   # Update the stability
            similarity=0.7,                  # Update the similarity
        )
        # ... existing code ...