Skip to content

Latest commit

 

History

History

README.md

Python Bridge - Emotional Orchestration Engine (EOE)

The Python Bridge provides real-time, low-latency (<50ms) sensory processing for live streaming operations.

Purpose

While n8n handles asynchronous workflows, the Python Bridge handles:

  • Real-time chat velocity monitoring
  • Audio level detection
  • OBS scene control
  • Flash clipping triggers
  • Transparent overlay rendering

Architecture

┌─────────────────────────────────────────────────┐
│          Python Bridge (EOE)                    │
├─────────────────────────────────────────────────┤
│                                                 │
│  ┌──────────────┐    ┌──────────────┐          │
│  │ State        │───▶│ OBS Control  │          │
│  │ Evaluator    │    │ (WebSocket)  │          │
│  └──────────────┘    └──────────────┘          │
│         │                                       │
│         ▼                                       │
│  ┌──────────────┐    ┌──────────────┐          │
│  │ Chat Monitor │    │ Audio Monitor│          │
│  │ (Twitch IRC) │    │ (PyAudio)    │          │
│  └──────────────┘    └──────────────┘          │
│                                                 │
└─────────────────────────────────────────────────┘

Setup

  1. Install Dependencies

    cd python-bridge
    python3 -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
  2. Configure OBS

    • Enable WebSocket Server (Tools → WebSocket Server Settings)
    • Port: 4455
    • Password: (set in .env)
  3. Run

    python eoe_engine.py

State Machine

State Trigger Action
HYPE PEAK Chat Velocity > 20 AND Audio > -15dB SaveReplayBuffer + Flash Clip
DEAD AIR Chat Velocity < 5 AND Audio < -40dB AI Conversation Starter
GETTING COOKED Chat Velocity > 25 AND Audio < -35dB Sarcastic Overlay

Files (To Be Created in Phase 1)

  • eoe_engine.py - Main orchestration engine
  • state_evaluator.py - Entropy calculation
  • obs_controller.py - OBS WebSocket client
  • chat_monitor.py - Twitch IRC listener
  • audio_monitor.py - Audio level detection
  • flash_clipper.py - Automated clip generation