Documentation
¶
Overview ¶
Package dtmf provides a DTMF aggregator that accumulates InputDTMFFrame digits and emits TranscriptionFrame on timeout, termination digit (#), or EndFrame/CancelFrame.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Processor ¶
type Processor struct {
*processors.BaseProcessor
Timeout time.Duration
TerminationDigit frames.KeypadEntry
Prefix string
PushInterruption bool // if true, push InterruptionFrame on first digit
// contains filtered or unexported fields
}
Processor aggregates DTMF digits and flushes as TranscriptionFrame for LLM context.
func New ¶
func New(name string, timeout time.Duration, terminationDigit frames.KeypadEntry, prefix string) *Processor
New returns a DTMF aggregator. Timeout 0 defaults to 2s; empty Prefix to "DTMF: ".
func (*Processor) ProcessFrame ¶
func (p *Processor) ProcessFrame(ctx context.Context, f frames.Frame, dir processors.Direction) error
ProcessFrame accumulates InputDTMFFrame digits; flushes on timeout, #, or End/Cancel.
Click to show internal directories.
Click to hide internal directories.