Local-first streaming system for TikTok Live. Transforms live comments and gifts into contextual AI speech, local TTS, and synchronized animations.
Real-time Autonomous AI Character for TikTok Live · Local Prototype
CapyOwlCat is an interactive AI character system built for live streaming content. It receives TikTok Live comments and gifts, prioritizes incoming events, generates in-character responses with Grok, synthesizes speech through a local Piper TTS service, and coordinates the character's visual behavior through a timeline-driven animation state machine.
The system includes a dedicated operator workspace for managing animations, reactions, voices, visual layers, subtitles, background audio, and broadcast composition. Built as a completed local-first prototype demonstrating a high-performance real-time AI and media pipeline.
Replaced cloud TTS services with a locally hosted FastAPI Python wrapper around Piper TTS. Reduces voice generation latency to milliseconds and ensures zero external bandwidth dependency during live broadcasts.
Implements bounded queues in Zustand to handle live stream spam. High-value gifts trigger immediate combo aggregation and queue preemption over generic chat messages.
An extended Finite State Machine synchronizes audio phonemes, subtitles, background audio, and sprite visual layers, ensuring lip-sync alignment and smooth animation transitions without frame drops.
A built-in Next.js operator interface offering real-time 9:16 virtual monitor previews, live chroma-key adjustment, layer stacking, and manual emotion/reaction triggers.
Custom prompt engineering and context sliding window for xAI Grok. Keeps responses concise, humorous, and strictly in-character while processing live chat dynamics.
Differentiates between user comments, viewer gifts, sub triggers, and system events, shaping the AI persona's cognitive reaction accordingly.
Parses synthesized audio duration and streams word-by-word subtitles matching character speech cadence in real time.
Full manual control dashboard to override AI responses, trigger custom gift animations, tweak voice pitches, or pause stream events on demand.
Handles real-time video compositing, transparent background keying, and audio channel mixing for OBS broadcast output.