CircuitForge voice annotation pipeline — VoiceFrame API, tone classifiers, speaker diarization
Find a file
pyr0ball 6e17da9e93 feat: AudioEvent models, classify_chunk() for per-chunk request-response path
- events.py: AudioEvent dataclass + ToneEvent with affect, shift_magnitude,
  shift_direction, prosody_flags; make_subtext() for generic/Elcor formats
- context.py: classify_chunk(audio_b64, timestamp, prior_frames, elcor)
  returns list[AudioEvent]; mock mode uses MockVoiceIO RNG, real raises NotImplementedError
- ToneEvent.__post_init__ pins event_type='tone' (avoids MRO default-field ordering bug)
- Elcor mode: same classifier output, Elcor speech-prefix wording; all tiers
2026-04-06 16:53:10 -07:00
cf_voice feat: AudioEvent models, classify_chunk() for per-chunk request-response path 2026-04-06 16:53:10 -07:00
tests feat: initial cf-voice stub — VoiceFrame API, mock IO, context classifier 2026-04-06 16:03:07 -07:00
.gitignore feat: initial cf-voice stub — VoiceFrame API, mock IO, context classifier 2026-04-06 16:03:07 -07:00
pyproject.toml feat: initial cf-voice stub — VoiceFrame API, mock IO, context classifier 2026-04-06 16:03:07 -07:00
README.md feat: initial cf-voice stub — VoiceFrame API, mock IO, context classifier 2026-04-06 16:03:07 -07:00

cf-voice

CircuitForge voice annotation pipeline. Produces VoiceFrame objects from a live audio stream — tone label, confidence, speaker identity, and shift magnitude.

Status: Notation v0.1.x stub — mock mode only. Real classifiers (YAMNet, wav2vec2, pyannote.audio) land incrementally.

Install

pip install -e ../cf-voice   # editable install alongside sibling repos

Quick start

from cf_voice.context import ContextClassifier

classifier = ContextClassifier.mock()          # or from_env() with CF_VOICE_MOCK=1
async for frame in classifier.stream():
    print(frame.label, frame.confidence)

Or run the demo CLI:

CF_VOICE_MOCK=1 cf-voice-demo

VoiceFrame

@dataclass
class VoiceFrame:
    label: str            # e.g. "Warmly impatient"
    confidence: float     # 0.01.0
    speaker_id: str       # ephemeral local label, e.g. "speaker_a"
    shift_magnitude: float  # delta from previous frame, 0.01.0
    timestamp: float      # session-relative seconds

Mock mode

Set CF_VOICE_MOCK=1 or pass mock=True to make_io(). No GPU or microphone required. Useful for CI and frontend development.

Module structure

Module License Purpose
cf_voice.models MIT VoiceFrame dataclass
cf_voice.io MIT Audio capture, mock generator
cf_voice.context BSL 1.1* Tone classification, diarization

*BSL applies when real inference models are integrated. Currently stub = MIT.

Consumed by

  • Circuit-Forge/linnet — real-time tone annotation widget
  • Circuit-Forge/osprey — telephony bridge voice context