dtmf_aggregator
DTMF aggregation processor for converting keypad input to transcription.
This module provides a frame processor that aggregates DTMF (Dual-Tone Multi-Frequency) keypad inputs into meaningful sequences and converts them to transcription frames for downstream processing by LLM context aggregators.
- class pipecat.processors.aggregators.dtmf_aggregator.DTMFAggregator(timeout: float = 2.0, termination_digit: KeypadEntry = KeypadEntry.POUND, prefix: str = 'DTMF: ', **kwargs)[source]
Bases:
FrameProcessorAggregates DTMF frames into meaningful sequences for LLM processing.
The aggregator accumulates digits from InputDTMFFrame instances and flushes when:
Timeout occurs (configurable idle period)
Termination digit is received (default: ‘#’)
EndFrame or CancelFrame is received
Emits TranscriptionFrame for compatibility with existing LLM context aggregators.
- __init__(timeout: float = 2.0, termination_digit: KeypadEntry = KeypadEntry.POUND, prefix: str = 'DTMF: ', **kwargs)[source]
Initialize the DTMF aggregator.
- Parameters:
timeout – Idle timeout in seconds before flushing
termination_digit – Digit that triggers immediate flush
prefix – Prefix added to DTMF sequence in transcription
**kwargs – Additional arguments passed to FrameProcessor
- async process_frame(frame: Frame, direction: FrameDirection) None[source]
Process incoming frames and handle DTMF aggregation.
- Parameters:
frame – The frame to process.
direction – The direction of frame flow in the pipeline.