neonForge

artificer3120

ecoute2 — Code Audit

auditor: jellia (mrFixit)  |  2026-05-05  |  QB #642

Overview

ecoute2 is a voice conversation widget that enables spoken interaction with agents via localMesh. It captures audio, transcribes via faster-whisper (subprocess), dispatches text to agents through localMesh messaging, polls for responses, and plays them back via TTS.

Two builds exist:

The forge9 variant should be archived — canonical is clearly ahead in every dimension.

File Inventory

Canonical — dev/ecoute2/

FileLinesPurpose
ecoute2.py659Main widget (DOMStack BaseFrame), audio pipeline, mailbox poller
transcriber.py25Subprocess worker: faster-whisper STT
tts_worker.py98ElevenLabs + edge-tts generation, sounddevice playback
sizer.py123Companion slider for live widget resizing (Win32 MoveWindow)

Experimental — forges/forge9/ecoute2/

FileLinesPurpose
ecoute2.py504Standalone widget (no BaseFrame), pyttsx3 local TTS
transcriber.py25Same subprocess whisper worker

Surfaces

ecoute2 is client-only — it binds no ports. All connections are outbound.

TargetProtocolPurpose
127.0.0.1:8801HTTPlocalMesh — messaging, registry, mailbox
100.83.251.119:8120HTTPVault API — ElevenLabs key fetch at startup
ElevenLabs APIHTTPSTTS generation (meech/Stiles voice)
edge-tts (Microsoft)HTTPSTTS fallback (rachel, adam, sam voices)

localMesh Endpoints Used

MethodPathPurpose
GET/registry/onlineLoad online agents for dropdown
GET/mailbox/ecoute2Poll for agent responses (2s interval)
POST/messageSend transcribed text to agent

Stack

LayerTechnology
LanguagePython 3.12
GUIPyQt5 via DOMStack BaseFrame (untitledSDK)
STTfaster-whisper (base model, CPU, int8) — subprocess
TTS primaryElevenLabs API (Stiles voice, turbo v2.5) — subprocess
TTS fallbackedge-tts (Microsoft) — subprocess
Audio capturePyAudio (16kHz, mono, 1024 chunk)
Audio playbacksounddevice + soundfile — subprocess
MessaginglocalMesh HTTP API (:8801)
CredentialsVault API (ElevenLabs key)

Voice Pipeline Flow

[Mic] → PyAudio capture → WAV file → transcriber.py (whisper) → transcript review → SEND → localMesh /message → agent mailbox → nudge.py
[Agent responds] → mailbox poll (2s) → inbound queue → PLAY → tts_worker.py (ElevenLabs/edge-tts) → sounddevice → [Speaker]

Observations

forge9 should be archived — canonical build is ahead in every feature. No reason to maintain both.
MailboxPoller never marks messages as read. They accumulate in the .jsonl file forever.
All ecoute2 sessions share one mailbox (ecoute2.jsonl). Concurrent sessions would cross-receive messages.
ElevenLabs keys may be expired. If key fetch fails at startup, meech voice has no fallback to edge-tts.
No reconnect logic — if localMesh goes down mid-session, all sends/polls fail silently.
DLL isolation (subprocess for whisper + TTS) avoids PyQt5/torch conflicts. Good engineering call.
Thread safety via pyqtSignal is clean — no shared mutable state between threads.