hearing.pipeline¶
Pipeline assembly — compose the four concerns by dependency injection.
This is where progressive disclosure lives: transcribe("meeting.wav") is a
one-liner with smart defaults, while the engine, diarizer, agent, channel
routing, and persistence are all optional keyword-only arguments. The same
shape powers the live path (live_transcribe); only the source and the
trigger cadence differ (milestone 2).
See the hearing-architecture skill — this module is the thin orchestrator it
describes; swapping any one component touches only the assembly call.
Functions
|
Stream FINALIZED segments as a meeting unfolds (the live path). |
|
Transcribe (if needed) then run an agent to produce meeting notes. |
|
Transcribe an audio source to a |
- async hearing.pipeline.live_transcribe(*, source, engine=None, diarizer=None, agent=None, audio_queue_max=50, segment_queue_max=100)[source]¶
Stream FINALIZED segments as a meeting unfolds (the live path).
Same components as
transcribe()— only the source (a streamingCaptureSourceinstead of a file) and the trigger cadence (VAD utterance turn-ends instead of run-once) change. TheSTTEngineandAgentConsumerinterfaces are unchanged.Each channel is demuxed onto its own bounded queue and driven through
engine.stream_transcribeas an independent async task, so a slow agent never stalls capture (backpressure) and the channel “me vs them” label rides every segment. Diarization defaults to the free channel trick; the agent’son_segmentis fired fire-and-forget. Yields segments as utterances finalize.See the
hearing-live-pipelineskill.
- hearing.pipeline.summarize(source, *, agent=None, context=None, model=None, **transcribe_kwargs)[source]¶
Transcribe (if needed) then run an agent to produce meeting notes.
Accepts an audio source or an already-built
Transcript. Builds the default agent (Claude if available, else the offline extractive fallback) when none is injected.
- hearing.pipeline.transcribe(source, *, engine=None, diarizer=None, agent=None, language=None, split=True, mic_channels=(0,), system_channels=(1,), record=None)[source]¶
Transcribe an audio source to a
Transcript.The one-liner
transcribe("meeting.wav")works with all defaults: the default local engine (faster-whisper), automatic channel splitting when the file is multi-channel, and the free “me vs them” channel-trick diarizer.- Parameters:
source (
str|Path|CaptureSource) – a file path or anyCaptureSource.engine (
Optional[STTEngine]) – STT engine (default: faster-whisper). Inject anySTTEngine.diarizer (
Optional[Diarizer]) – speaker labeller.None-> the channel trick is applied automatically when channel info is present (mic=”me”, system=”them”). Inject aPyannoteDiarizerto separate individual remote speakers.agent (
Optional[AgentConsumer]) – optionalAgentConsumerrun over the finished transcript (batch). Its output is stored undertranscript.meta['insight'].language (
Optional[str]) – force a language code (e.g. “en”);None= auto-detect.split (
bool) – split mic/system channels when the source is multi-channel.system_channels (
Sequence[int]) – column indices for the channel split.record – optional
MutableMappingstore (e.g. a dol store) to persist the transcript JSON under key"<source>.transcript.json".
- Return type:
- Returns:
A
Transcript(iterable/len-able, so it stands in for a sequence of segments). Segments carry text, span, channel, and speaker.