dtmf

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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) Cleanup

func (p *Processor) Cleanup(ctx context.Context) error

Cleanup stops the idle timer and clears state.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL