I am allowing users to switch between different mo...
# ask-ai
a
I am allowing users to switch between different modes during a livekit session - voice (full voice agent), whisper (they type agent speaks) and silent (they type and agent does not speak). My engineer told me the following: • Currently: tts_plugin = None when starting in silent mode • Problem: Can't switch back to voice/whisper because TTS doesn't exist • Solutions: • Option A: Always create TTS plugin, just disable audio output • Option B: Require session restart when switching from silent to voice • Option C: Dynamically create TTS plugin when switching (complex) What are your thoughts - I am wondering if in silent mode I could somehow keep the TTS plugin but just not leverage it. Rather than set it to None at the start of session.
t
Thanks for reaching out, Matt. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Great news! You can actually initialize the TTS plugin in a disabled state (think of it as silent mode) and then easily re-enable it later when you're ready to use voice or whisper modes. This way, you won’t have to set the TTS plugin to
None
at the start of your session, which makes things a bit smoother. Here’s a simple way to do it: just disable audio output during initialization with methods like
set_audio_enabled(False)
. Then, when you want to switch to voice or whisper modes, you can just toggle the audio back on with
set_audio_enabled(True)
. It’s pretty straightforward! Now, about whisper mode—while there isn’t a specific "whisper mode" API, some TTS plugins let you adjust volume or tweak the voice to create a whisper-like effect. For example: • Cartesia TTS: Try adjusting the
volume
parameter. • Minimax TTS: Play around with
vol
,
intensity
, and
timbre
parameters. • Google TTS: Modify the
volume_gain_db
parameter. This way, you keep your TTS plugin initialized and ready to switch modes anytime without needing to restart the session or deal with complicated setups. If you have any questions or want to explore this further, feel free to ask—I’m here to help! Sources: Text and transcriptions | LiveKit docs | livekit-plugins/livekit-plugins-minimax/livekit/plugins/minimax/tts.py