vox

package
v0.0.0-...-846bd6e Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModel

func NewModel(filepath string) (*vosk.VoskModel, error)

Types

type PhraseResult

type PhraseResult struct {
	Text       string
	Confidence float64
	Start, End int
}

type Recognizer

type Recognizer struct {
	VoskRecognizer *vosk.VoskRecognizer

	Audio []byte
	// contains filtered or unexported fields
}

func NewRecognizer

func NewRecognizer(model *vosk.VoskModel, sampleRate, bitDepth int, phrases []string) (*Recognizer, error)

func (*Recognizer) Accept

func (r *Recognizer) Accept(audio []byte) (bool, error)

func (*Recognizer) FinalResults

func (r *Recognizer) FinalResults() []Result

func (*Recognizer) Free

func (r *Recognizer) Free()

func (*Recognizer) Reset

func (r *Recognizer) Reset()

func (*Recognizer) Results

func (r *Recognizer) Results() []Result

func (*Recognizer) SetGrm

func (r *Recognizer) SetGrm(phrases []string)

func (*Recognizer) SetKeyphrases

func (r *Recognizer) SetKeyphrases(b bool)

func (*Recognizer) SetMaxAlternatives

func (r *Recognizer) SetMaxAlternatives(n int)

func (*Recognizer) SetPartialWords

func (r *Recognizer) SetPartialWords(b bool)

func (*Recognizer) SetWords

func (r *Recognizer) SetWords(b bool)

type Result

type Result struct {
	Text           string
	Phrases        []PhraseResult
	Confidence     float64
	Valid, Partial bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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