Adventists - API Doc
  1. TCP - Chat With Voice
Adventists - API Doc
  • Overall
  • v2.5 Updates
  • Quick Start
  • TCP - Chat With Voice
    • Connect with TCP
    • Connect with VAD
    • Connect with MCP
    • Get Token
      POST
  • Settings Management
    • Args Description
    • Template
      • Query Public Template List
      • Query Current Org Template (including private and public template)
      • Create Template
      • Query Template By ID
      • Modify Template
      • Delete Template
      • Send Memories To Template
    • NPC
      • Create Npc With Template
      • Create Npc Without Template
      • Query Npc By Id
      • Modify Npc
      • Delete Npc
      • Send Memories To Npc
      • Query Memories From Npc
    • Skills Book
      • Query Skills Book List
      • Start Create Skills Book Task
      • Upload Skills Book Content
      • Finish Create Skills Book Task
      • Query Progress Of Create Skills Book Task
    • Voice Texture
      • Upload Voice Texture
        • Upload Voice
        • Query Status Of Uploading Voice
      • Query Voice List
  • Other Chat Functions
    • Upload Pictures
      POST
  1. TCP - Chat With Voice

Connect with VAD

Quick-Start Guide for VAD#

Important Clarification#

⚠️ Connection Protocol: This project uses TCP, not WebSocket.
VAD is built on top of the existing TCP protocol to provide automatic voice-activity detection.

Overview#

TCP v2.5 introduces VAD (Voice Activity Detection).
The server automatically senses when the user starts and stops speaking, enabling a more natural voice-interaction experience.

Quick Start#

1. Basic Integration (Recommended for New Users)#

2. Upgrade for Existing Users#

Simply add the mode:auto parameter to your current authentication message:
Key Changes:
No need to send END_FRAME
Listen for the server's LISTEN messages
Audio can be sent continuously

Mode Comparison#

FeatureManual Mode (Legacy)Auto Mode (New)
End-of-speech detectionClient sends END_FRAMEServer VAD auto-detects
Audio format requirementPCM or OpusOpus required
Interaction stylePush-to-talkHands-free
Noise handlingNoneAuto-filtered
CompatibilityFully backward-compatibleRequires client adaptation

Step-by-Step Integration#

Step 1: Audit Your Current Implementation#

Step 2: Update Authentication Logic#

Step 3: Handle LISTEN Messages#

Step 4: Modify Audio-Sending Logic#

Best Practices#

1. UI Design#

2. Audio-Quality Optimization#

3. Force-Stop a Dialogue#

4. Error-Recovery Mechanism#

Performance-Tuning Tips#

1. Audio-Buffer Management#

2. Network Optimization#

Troubleshooting#

Common Issues#

1.
VAD not working
Verify Opus format is used
Confirm server returns mode “auto”
Check console for VAD-init errors
2.
Frequent false triggers
Measure ambient-noise level
Lower microphone gain
Contact support to tune VAD thresholds
3.
High latency
Measure network RTT
Tune encoder settings
Consider Manual mode for ultra-low delay

Debug Tips#

Summary#

VAD delivers a more natural voice-interaction experience.
Keep these essentials in mind:
1.
Auto mode supports both PCM and Opus (Opus recommended for better performance)
2.
Listen for the server’s LISTEN messages
3.
No END_FRAME required
4.
Implement robust error handling and reconnection logic
For further assistance, please contact technical support.
修改于 2025-09-15 03:55:04
上一页
Connect with TCP
下一页
Connect with MCP
Built with