Voice for robots
With lively.ai, your robot gets a voice that listens, takes turns and moves with what it says. One real-time API for speech and the body cues that go with it.
What your robot gets
A conversation partner, not a speaker on wheels
Conversation in real time
Speech in, speech out, streamed both ways. The robot keeps listening while it talks, so it hears an interruption as it happens.
Turn-taking people expect
With lively.ai, your robot tells a pause from a finished thought, answers without a long silence, and stops talking when someone cuts in.
A body that matches the voice
Ahead of the sound, the API says when a reply will start, where it pauses and when it ends. Your robot gets ready to speak, holds through pauses and hands the turn over on time.
How it works
One session carries the whole exchange
Stream what the robot hears
Open a session with your API key and send microphone audio as it arrives.
Receive speech and turn cues
The lively.ai API returns the robot's voice as audio and, ahead of the sound, turn cues: when the reply starts, where it pauses and when it ends.
Play and perform
The client plays the audio and calls your code at each cue, with the time left before the sound. Your mapping table picks the movement.
import asyncio, os
from lively_ai import LivelyAI
# Your mapping: the movement that shows each turn cue.
MOVES = {
"bid": "lift_head", # about to speak
"hold": "keep_posture", # pause inside a reply
"yield": "face_partner", # handing the turn over
"cancelled": "rest", # reply dropped
"interrupted": "rest", # the person cut in
}
async def main():
client = LivelyAI(api_key=os.environ["LIVELY_API_KEY"])
session = client.session(language="en")
@session.on_turn_cue
def move(cue):
# lead_ms: time left until the sound it announces
robot.play(MOVES[cue.name], within_ms=cue.lead_ms)
await session.run(microphone, speaker)
asyncio.run(main())Cue mapping
One set of cues, any body
A turn cue says where the robot is in its turn, not which joints to move. A mapping table on your side names the movement that shows each cue on your robot. Showing a cue differently is a change to the table, not to code.
| Cue | Humanoid with no neck or eyes | Avatar on a screen |
|---|---|---|
| Bidabout to speak | Waist turns aside, one arm rises | Mouth opens, eyes and head turn away |
| Holdpause inside a reply | Stays turned, arm stays up | Keeps looking away |
| Yieldhanding the turn over | Arm lowers, torso faces the partner | Eyes return to the partner, mouth closes |
| Interruptedthe person cut in | Returns to listening at once | Returns to listening at once |
Two example mappings. Yours can use any movement your robot has.
Give your robot a voice
Create a lively.ai account and tell us about your use case. Our team will contact you.