Versions in this module Expand all Collapse all v0 v0.11.3 Dec 1, 2026 Changes in this version + var ErrClosed = errors.New("speechcpp: session is closed") + var ErrConfig = errors.New("speechcpp: invalid session configuration") + var ErrEnded = errors.New("speechcpp: session's input has ended") + var ErrSettingType = errors.New("speechcpp: setting value of an unsupported type") + type Config struct + Detection []Setting + PartialInterval time.Duration + Recognition []Setting + SampleRate int + type Event struct + Early bool + End float64 + Err error + Kind EventKind + Languages []string + Region int + Segments []speech.Segment + Start float64 + Text string + Tokens []speech.Token + Untimed string + type EventKind int + const EventError + const EventFinal + const EventPartial + func (k EventKind) String() string + type Session struct + func NewSession(recognition, detection *speech.Model, cfg Config) (*Session, error) + func (s *Session) Close() + func (s *Session) End() error + func (s *Session) Events() <-chan Event + func (s *Session) Push(samples []float32) error + type Setting struct + Option speech.Option + Value any + func Language(tag string) Setting + func MaxSpeech(d time.Duration) Setting + func MinSilence(d time.Duration) Setting + func MinSpeech(d time.Duration) Setting + func Prompt(text string) Setting + func SpeechPad(d time.Duration) Setting + func Threshold(p float64) Setting + func Timestamps(on bool) Setting