expression.py

projectBEA · src/core/expression.py · python · MIT
voice, tag:obs-avatar-animation, tag:speech-interruption

Centralizes voice output by managing TTS generation, audio playback, OBS avatar animations, and speech interruption/resume logic for local and remote routing.

# Source: https://github.com/emqnuele/projectBEA | License: MIT | Copyright 2026 Emanuele Faraci
# Provided via justclaw.it.com; keep this notice with the code.
import asyncio
import io
import time
from pathlib import Path
from typing import Optional, Tuple

from src.core.config import BrainConfig
from src.core.events import EventManager, EventCategory
from src.core.resources import resolve_mood_paths
from src.interfaces.base_interfaces import TTSInterface, OBSInterface
from src.utils.logger import get_logger

logger = get_logger("bea.expression")


class Expression:
    """The single output sink for everything Bea expresses.

    Owns the VOICE actuator: TTS generation, local audio playback, OBS avatar/text
    animation, barge-in/interruption and the resume buffer. Every surface that use

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key