liveavatar-debug
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLiveAvatar Debugging Guide
LiveAvatar 调试指南
Symptom-based troubleshooting for LiveAvatar integrations. Find your symptom below and follow the fix.
针对LiveAvatar集成的基于症状的排查指南,在下方找到你遇到的问题症状并按照修复方案操作。
Avatar is silent / not responding to speech
虚拟形象无声音/不回应语音
Most likely: Missing in FULL Mode.
context_idWithout a , the avatar enters restricted mode — streams video but ignores user input. No error thrown.
context_idFix: Create a context via with at least a field. Include the returned in your session token's .
POST /v1/contextspromptcontext_idavatar_personaOther causes:
- Browser mic permissions blocked (check on iframe)
allow="microphone" - Push-to-Talk enabled but PTT events not being sent
- OS-level mic mute
最可能原因:FULL Mode 中缺失 参数
context_id缺少 时,虚拟形象会进入受限模式——正常推流视频但会忽略用户输入,不会抛出任何错误。
context_id修复方案: 通过 接口创建上下文,请求中至少包含 字段。将接口返回的 填入会话令牌的 字段中。
POST /v1/contextspromptcontext_idavatar_persona其他可能原因:
- 浏览器麦克风权限被阻止(检查iframe上的 属性配置)
allow="microphone" - 开启了按键说话功能但未发送PTT事件
- 系统层面麦克风被静音
Audio is garbled or distorted (LITE Mode)
音频失真或有杂音(LITE Mode)
Most likely: Wrong audio format.
Required: PCM 16-bit signed, 24KHz, base64. No error returned for wrong format.
Checklist:
- Sample rate is exactly 24,000 Hz
- Raw PCM (no WAV/MP3/OGG headers)
- 16-bit signed, not 8-bit or 32-bit float
- Base64 encoded
- Chunks under 1MB
Quick test: Send a known-good 440Hz test tone. If it works but your TTS doesn't, resample your TTS output.
最可能原因:音频格式错误
要求格式:PCM 16位有符号、24KHz、base64编码。格式错误时不会返回错误提示。
检查清单:
- 采样率精确为24,000 Hz
- 原始PCM格式(无WAV/MP3/OGG文件头)
- 16位有符号,非8位或32位浮点格式
- 已做Base64编码
- 数据块大小小于1MB
快速测试方法: 发送一个已知正常的440Hz测试音。如果测试音正常但你的TTS输出异常,请对TTS输出进行重采样。
401 error / session fails to start
401错误/会话无法启动
Most likely: Wrong auth header.
| Endpoint | Correct auth |
|---|---|
| |
| |
Common mistakes: using API key on , using Bearer token on , putting API key in Bearer format.
/start/token最可能原因:认证头配置错误
| 端点 | 正确认证方式 |
|---|---|
| |
| |
常见错误:在 接口使用API密钥,在 接口使用Bearer令牌,将API密钥按Bearer格式拼接。
/start/tokenEvents not received (FULL Mode)
接收不到事件(FULL Mode)
- Subscribed to correct topics? Send to , receive from
agent-controlagent-response - LiveKit room connected? Check connection state
- Parsing JSON correctly? Events have ,
event_type,event_idsession_id
- 是否订阅了正确的主题?向 发送事件,从
agent-control接收事件agent-response - LiveKit房间是否已连接?检查连接状态
- JSON解析是否正确?事件包含 、
event_type、event_id字段session_id
WebSocket events silently dropped (LITE Mode)
WebSocket事件被静默丢弃(LITE Mode)
Most likely: Sending before .
connectedWait for before sending any commands.
{"type": "session.state_updated", "state": "connected"}Also check:
- Using correct event names? LITE uses , not
agent.*(that's FULL)avatar.* - WebSocket still open? 5-min inactivity timeout
最可能原因:在连接建立完成前发送数据
请等待收到 事件后再发送任何命令。
{"type": "session.state_updated", "state": "connected"}其他检查项:
- 是否使用了正确的事件名?LITE模式使用 前缀,而非
agent.*(该前缀是FULL模式使用)avatar.* - WebSocket连接是否仍处于开启状态?无操作5分钟会自动超时
Session times out
会话超时
5 minutes of inactivity kills the session.
- FULL: with
POST /v1/sessions/keep-aliveBearer <session_token> - LITE: via WebSocket
{"type": "session.keep_alive", "event_id": "..."}
Send every 2-3 minutes.
5分钟无操作会自动终止会话。
- FULL模式: 携带 请求
Bearer <session_token>接口POST /v1/sessions/keep-alive - LITE模式: 通过WebSocket发送
{"type": "session.keep_alive", "event_id": "..."}
建议每2-3分钟发送一次心跳请求。
Sandbox won't start
沙箱环境无法启动
- set in session token
is_sandbox: true - Avatar ID is (sessions) or
dd73ea75-1218-4ef3-92ce-606d5f7fbc0a(embeds)65f9e3c9-d48b-4118-b73a-4ae2e3cbb8f0 - Not using a different avatar with sandbox mode
~1 minute auto-termination is expected behavior.
- 会话令牌中已设置
is_sandbox: true - 虚拟形象ID为 (会话场景)或
dd73ea75-1218-4ef3-92ce-606d5f7fbc0a(嵌入场景)65f9e3c9-d48b-4118-b73a-4ae2e3cbb8f0 - 沙箱模式下未使用其他虚拟形象ID
约1分钟自动终止是沙箱环境的预期行为。
Image avatar fails / no audio
图片虚拟形象运行失败/无音频
Image avatars have no auto-generated voice. Specify in . Browse voices at .
voice_idavatar_personaGET /v1/voices图片虚拟形象不会自动生成语音,请在 中指定 。可通过 接口查询可用音色列表。
avatar_personavoice_idGET /v1/voicesCustom LLM / TTS not working
自定义LLM/TTS无法正常工作
LLM checklist:
- Secret:
secret_type: "LLM_API_KEY" - Config: correct ,
model,secret_idbase_url - in session token
llm_configuration_id - Endpoint supports OpenAI protocol
/chat/completions
TTS checklist:
- Secret:
secret_type: "ELEVENLABS_API_KEY" - Voice imported via
POST /v1/voices/third_party - Using the returned LiveAvatar voice_id (not the ElevenLabs ID)
LLM检查清单:
- 密钥配置:
secret_type: "LLM_API_KEY" - 配置项:、
model、secret_id配置正确base_url - 会话令牌中已传入
llm_configuration_id - 端点支持OpenAI 协议
/chat/completions
TTS检查清单:
- 密钥配置:
secret_type: "ELEVENLABS_API_KEY" - 音色已通过 接口导入
POST /v1/voices/third_party - 使用接口返回的LiveAvatar voice_id(而非ElevenLabs的ID)
CORS / network errors
CORS/网络错误
- API calls should come from backend, not browser
- Allow outbound for LiveKit and WebSocket
wss:// - Allow ,
*.livekit.cloud,api.liveavatar.comembed.liveavatar.com
- API请求应从后端发送,而非浏览器端
- 允许出站的 请求,用于LiveKit和WebSocket连接
wss:// - 放开 、
*.livekit.cloud、api.liveavatar.com域名访问限制embed.liveavatar.com
General approach
通用排查思路
- Start with sandbox mode to eliminate billing issues
- Check session state:
GET /v1/sessions/{id} - Check transcript:
GET /v1/sessions/{id}/transcript - Check credits:
GET /v1/users/credits - Verify you're not mixing FULL and LITE event systems
- 先使用沙箱模式排查,排除计费相关问题
- 检查会话状态:
GET /v1/sessions/{id} - 检查会话转写记录:
GET /v1/sessions/{id}/transcript - 检查账户额度:
GET /v1/users/credits - 确认你没有混用FULL和LITE模式的事件体系