hearing.interfaces¶
Facade Protocols for the four pipeline concerns.
Every engine/component is dependency-injected as one of these; the pipeline
depends only on these interfaces, never on a concrete engine. Implementers
satisfy them structurally (typing.Protocol) — they do not subclass.
This is the contract the hearing-architecture skill defines and that every
other hearing-* concern implements against.
Classes
|
Consumes the (labeled) transcript stream and does things. |
|
Audio source — the ONLY thing that differs between batch and live. |
|
Labels who spoke — enriches segments with |
|
Speech-to-text. |
- class hearing.interfaces.AgentConsumer(*args, **kwargs)[source]¶
Bases:
ProtocolConsumes the (labeled) transcript stream and does things.
Running notes, suggested questions, RAG over related docs, post-meeting summaries. Defaults to Claude but stays pluggable (see the
claude-apiskill for model ids / pricing / tool use).
- class hearing.interfaces.CaptureSource(*args, **kwargs)[source]¶
Bases:
ProtocolAudio source — the ONLY thing that differs between batch and live.
Yields
(channel, frames)so mic and system audio stay on separate channels all the way down. A batch implementation reads a file; a live implementation reads a device/tap.
- class hearing.interfaces.Diarizer(*args, **kwargs)[source]¶
Bases:
ProtocolLabels who spoke — enriches segments with
.speaker.May use the audio (pyannote) or just the channel (the channel trick). Identity resolution (
spk_0->"Alice") is an optional further step behind the same interface.
- class hearing.interfaces.STTEngine(*args, **kwargs)[source]¶
Bases:
ProtocolSpeech-to-text.
transcribeis the batch one-liner;stream_transcribeis the live variant. Both yieldTranscriptSegment— same shape, same spine. The rest of the architecture never names a concrete engine.- async stream_transcribe(frames, *, sample_rate)[source]¶
Live: yield interim then finalized segments as audio arrives.
Mark interim vs final via
meta(e.g.meta['final']). See thehearing-live-pipelineskill — this is the milestone-2 entry point.- Return type: