How tianyupaipai-cmd/pai-voice works
PaiVoice is a self-hostable real-time voice/video calling layer with a replaceable browser client, ASR, reply adapter, and TTS. The main workflow captures microphone audio, sends it to the WebSocket core for transcription, obtains a reply through an HTTP adapter, and returns text/audio for playback. Video and screen-sharing form a parallel vision path; call events also reach the chosen adapter. The README documents additional integration options, but only the tmux and file adapters are present in this tree. Relationships are limited to excerpted code and README statements.
Main entry points: server.py Call and turn core · voice-call.js Voice client · reply.js Reply helper · server.js File adapter
Components 15
Browser calling
- Voice client
packages/web-client/voice-call.js
Realtime core
- Call and turn core
packages/realtime-core/server.py - ASR provider
- TTS provider
- Vision call handling
packages/realtime-core/server.py
Visual processing
- Vision model chain
packages/realtime-core/vision.py - Vision API
Reply adapters
- Adapter HTTP endpoint
packages/realtime-core/server.py - tmux adapter
packages/adapters/tmux/server.js - User tmux session
- File adapter
packages/adapters/file/server.js - Inbox JSONL
- Reply helper
packages/adapters/tmux/reply.js
Other components
- Caller
- Terminal agent
Connections 19
- Caller → Voice client: speaks and views
README.md - Voice client → Call and turn core: sends call events
README.md - Call and turn core → ASR provider: transcribes audio
packages/realtime-core/server.py - Call and turn core → Adapter HTTP endpoint: requests reply
packages/realtime-core/server.py - Adapter HTTP endpoint → tmux adapter: routes HTTP
- Adapter HTTP endpoint → File adapter: routes HTTP
- tmux adapter → User tmux session: injects turn and events
packages/adapters/tmux/server.js - Terminal agent → Reply helper: submits reply
README.md - Reply helper → tmux adapter: posts reply
packages/adapters/tmux/reply.js - File adapter → Inbox JSONL: appends records
packages/adapters/file/server.js - Terminal agent → Reply helper: submits reply
README.md - Call and turn core → TTS provider: synthesizes reply
README.md - Call and turn core → Voice client: streams response audio
README.md - Voice client → Vision call handling: sends video frames
packages/web-client/voice-call.js - Vision call handling → Vision model chain: requests descriptions
packages/realtime-core/server.py - Vision model chain → Vision API: sends images
packages/realtime-core/vision.py - Vision call handling → Adapter HTTP endpoint: notifies visual events
packages/realtime-core/server.py - Call and turn core → Adapter HTTP endpoint: forwards call events
packages/realtime-core/server.py - File adapter → Reply helper: offers reply command
packages/adapters/file/server.js