Commit Graph

78 Commits

Author SHA1 Message Date
d4e25ceb88 Stream TTS audio to caller in real-time chunks
TTS audio was sent as a single huge WebSocket frame that overflowed the
browser's 3s ring buffer. Now streams in 60ms chunks at real-time rate.
Also increased browser ring buffer from 3s to 10s as safety net.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:56:22 -07:00
97d37f3381 Send AI TTS audio to live caller during auto-respond
The auto-respond function played AI TTS to the local Loopback channel
but didn't send it over WebSocket to the live caller in the browser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:53:41 -07:00
eaedc4214b Reduce live caller latency and improve reliability
- Replace per-callback async task spawning with persistent queue-based sender
- Buffer host mic to 60ms chunks (was 21ms) to reduce WebSocket frame rate
- Reduce server ring buffer prebuffer from 150ms to 80ms
- Reduce browser playback jitter buffer from 150ms to 100ms

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:47:17 -07:00
af8606b5b7 Fix recording conflict when host stream is active
When a live caller is on air, the host stream already has an InputStream
open. Opening a second one for push-to-talk recording causes a conflict.
Now recording piggybacks on the host stream callback instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:42:07 -07:00
4d97ea9099 Replace queue with ring buffer jitter absorption for live caller audio
- Server: 150ms pre-buffer ring buffer eliminates gaps from timing mismatches
- Browser playback: 150ms jitter buffer (up from 80ms) for network jitter
- Capture chunks: 960 samples/60ms (better network efficiency)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:37:50 -07:00
7aed4d9c34 Fix live caller audio latency and choppiness
- Reduce capture chunk from 4096 to 640 samples (256ms → 40ms)
- Replace BufferSource scheduling with AudioWorklet playback ring buffer
- Add 80ms jitter buffer with linear interpolation upsampling
- Reduce host mic and live caller stream blocksizes from 4096/2048 to 1024
- Replace librosa.resample with numpy interpolation in send_audio_to_caller

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:32:27 -07:00
ab36ad8d5b Fix choppy audio and hanging when taking live callers
- Use persistent callback-based output stream instead of opening/closing per chunk
- Replace librosa.resample with simple decimation in real-time audio callbacks
- Move host stream initialization to background thread to avoid blocking
- Change live caller channel default to 9

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:24:27 -07:00
bcd0d96185 Fix slow hangup by moving LLM summarization and SFX to background
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:09:10 -07:00
cca8eaad84 Add live caller channel to audio settings
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:03:52 -07:00
edcd5ebb1b Bump app.js cache version to force browser reload
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:01:15 -07:00
41ddc8ee35 Remove Twilio dependencies and cleanup references
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 15:54:35 -07:00
a72c1eb795 Update tests for CallerService and browser caller format
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 15:53:41 -07:00
82ad234480 Add browser call-in page and update host dashboard for browser callers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 15:52:54 -07:00
863a81f87b Add continuous host mic streaming to real callers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 15:51:17 -07:00
bf140a77b7 Add browser caller WebSocket handler with PCM audio streaming
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 15:49:49 -07:00
06f334359e Remove Twilio endpoints and dependencies
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 15:48:12 -07:00
3961cfc9d4 Rename TwilioService to CallerService, remove Twilio-specific audio encoding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 15:45:08 -07:00
db134262fb Add frontend: call queue, active call indicator, three-party chat, three-way calls
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 13:46:19 -07:00
8dc1d62487 Add Twilio and Cloudflare tunnel setup docs 2026-02-05 13:44:24 -07:00
141f81232e Add AI follow-up system with call summarization and show history
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 13:42:35 -07:00
c82420ddad Add outbound audio streaming to real callers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 13:39:02 -07:00
88d7fd3457 Add Twilio WebSocket media stream handler with real-time transcription
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 13:36:04 -07:00
28ff8c2d16 Add Twilio webhook and queue management endpoints
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 13:33:03 -07:00
924ddca71a Add Twilio call queue service with channel allocation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 13:31:02 -07:00
00c2e8f018 Add Session multi-party call support and show history
- Add CallRecord dataclass for tracking call history
- Extend Session with call_history, active_real_caller, ai_respond_mode, auto_followup
- Add get_show_history() for AI caller context about earlier calls
- Update get_conversation_summary() to handle host/real_caller/ai_caller roles
- Update reset() to clear new fields
- Add tests for all new functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 13:25:32 -07:00
fad182f7e5 Add Twilio config and dependencies
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 13:20:30 -07:00
08df15df85 Add CLAUDE.md with project config and Gitea setup 2026-02-04 23:21:50 -07:00
029ce6d689 Initial commit: AI Radio Show web application
- FastAPI backend with multiple TTS providers (Inworld, ElevenLabs, Kokoro, F5-TTS, etc.)
- Web frontend with caller management, music, and soundboard
- Whisper transcription integration
- OpenRouter/Ollama LLM support
- Castopod podcast publishing script

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 23:11:20 -07:00