Can voice agent recognise tone of voice?
# ask-ai
f
Can voice agent recognise tone of voice?
t
Thanks for reaching out, Baymurat. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Absolutely! LiveKit voice agents can pick up on and respond to tone of voice. This happens thanks to the
MultimodalAgent
class working with OpenAI’s Realtime API, which listens to the audio and catches those emotional vibes and tonal details. The agent can understand things like emotion, pitch, and intonation, so it can adjust its responses to match how the caller is feeling. On top of that, you can make the agent’s tone even more expressive by using structured output from the language model. Developers can guide how the agent sounds—whether that’s friendly, calm, excited, or something else—using TTS directives. This works with OpenAI’s TTS models or other providers like Hume, who are pros at adding emotional flavor to synthesized speech. If you want to dive deeper or need a hand setting this up, just give me a shout! Sources: Working with the MultimodalAgent class | LiveKit Docs | Working with the MultimodalAgent class | LiveKit Docs | README.md | OpenAI TTS integration guide | LiveKit Docs | Hume TTS integration guide | LiveKit Docs
f
what about bad pronunciation and grammar mistakes?
t
LiveKit voice agents are pretty good at handling things like mispronunciations and grammar slip-ups by focusing on what you actually mean, rather than getting hung up on every little mistake. They treat the speech-to-text (STT) transcripts like a "rough draft" and use the context to figure out your intent, even if there are errors. When the intent is clear, the agent responds naturally without pointing out the mistakes. If something’s unclear, it might gently ask you to clarify or repeat your request. Also, you can customize how the agent pronounces certain words using Speech Synthesis Markup Language (SSML) with your TTS provider. This way, developers can make sure the agent sounds clear and natural when it replies. If you want a hand setting this up or picking the right STT/TTS provider, just let me know—I’m here to help! Sources: Testing and evaluation | LiveKit Docs | livekit-agents/livekit/agents/voice/generation.py | Agent speech and audio | LiveKit Docs | Agent speech and audio | LiveKit Docs | Agents v0.x migration guide - Node.js | LiveKit Docs
f
I wonder whether the agent can say that the users misprounced
t
Just a heads-up: LiveKit voice agents don’t come with a built-in feature to catch and fix mispronunciations automatically. But don’t worry—you can still make it happen by working with the speech-to-text (STT) transcription output. Here’s a simple way to think about it: 1. Pick out the key words or phrases where pronunciation really matters. 2. Use the STT transcription to capture what the user says. 3. Check the transcription against the correct pronunciations (you can do exact or fuzzy matching). 4. Set up your agent to gently correct the user when it spots something off. This way, your agent can really listen and give helpful, targeted feedback. Plus, you can use Speech Synthesis Markup Language (SSML) in the text-to-speech (TTS) system to model the right pronunciation—kind of like giving users a friendly example to follow. If you want a hand with setting this up or need recommendations on the best STT/TTS providers, just give me a shout—I’m here to help! Sources: examples/voice_agents/llamaindex-rag/query_engine.py | src/agent.ts | packages/sip--um-actually/src/agent.ts | How to Get Help from LiveKit | Speech & Audio Processing | livekit/livekit_composite | DeepWiki
f
how can I implement MultimodalAgent ?
t
To get started with a
MultimodalAgent
in LiveKit, here’s a friendly step-by-step guide for you: 1. Set up the environment: First, import the necessary libraries and initialize the
MultimodalAgent
class. You’ll want to use OpenAI’s Realtime API to handle both audio and text inputs smoothly. 2. Configure the agent: Next, set up parameters like instructions, voice, temperature, and which modalities to use. For example, you can make the agent ready to work with audio and text inputs dynamically, adapting as needed. 3. Handle dynamic updates: You can keep things flexible by using session configuration to update agent settings—like voice or instructions—in real time while it’s running. 4. Integrate function calling: Define custom functions so your agent can take actions based on what the user says, like booking appointments or transferring calls. It’s all about making interactions smoother. 5. Monitor events: Keep an eye on events such as
user_started_speaking
and
input_speech_transcription_completed
to manage the flow and publish transcriptions as needed. 6. Frontend integration: Connect the agent to your user interface using hooks like
useVoiceAssistant
. This way, you can provide visual feedback and show the current state to users, making the experience more engaging. 7. Telephony integration: If you’re working with phone systems, handle DTMF signals and call transfers using SIP integration to keep calls running smoothly. Does this sound good? If you want, I can share some detailed code examples or help you with any specific step—just let me know! Sources: Working with the MultimodalAgent class | LiveKit Docs | agent/main.py | web/src/components/code-viewer.tsx | OpenAI and LiveKit partner to turn Advanced Voice into an API | Agents 0.x migration guide | LiveKit Docs
f
how can I import the MultAgent Modal ?
t
Here’s a simple way to import and use the
MultimodalAgent
model in LiveKit—just follow these steps: 1. Install dependencies: First, make sure you’ve got the necessary packages installed:
pip install livekit livekit-agents livekit-plugins-openai python-dotenv
2. Import the class: Bring in the
MultimodalAgent
with this import:
from livekit.agents.multimodal import MultimodalAgent
3. Set up the model: Configure your
RealtimeModel
with things like instructions, voice, temperature, and the modalities you want to use:
Copy code
model = openai.realtime.RealtimeModel(
    instructions="You are a helpful assistant.",
    voice="shimmer",
    temperature=0.8,
    modalities=["audio", "text"]
)
4. Initialize the agent: Create your
MultimodalAgent
instance and start it in the room context:
Copy code
agent = MultimodalAgent(model=model)
agent.start(ctx.room, participant)
5. Handle events: Keep an eye on events like
user_started_speaking
or
user_speech_committed
to smoothly manage interactions. If you want me to walk you through any part or need some example code, just ask—I’m here to help! Sources: sip-refer/agent.py | agent/main.py | src/agent.ts | packages/sip--make-a-call/src/agent.ts | OpenAI and LiveKit partner to turn Advanced Voice into an API
f
But seems MultiAgentModel has already deprecated
t
Hey there! Just a quick heads-up: the
MultimodalAgent
has been deprecated in LiveKit Agents 1.0. It’s been replaced by
AgentSession
, which acts as a one-stop hub for all agent types. The cool part?
AgentSession
combines everything that
MultimodalAgent
and
VoicePipelineAgent
used to do, making it super smooth to work with both pipelined and speech-to-speech models. If you’d like a hand switching over to
AgentSession
or want some tips on how to use it in your project, just give me a shout—I’m here to help! Sources: Agents 0.x migration guide | LiveKit Docs | Agents v0.x migration guide - Node.js | LiveKit Docs