vox

package module
v0.0.0-...-917364d Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: AGPL-3.0 Imports: 7 Imported by: 1

README

vox

This is a more polished wrapper around the Vosk speech recognition Go bindings. It is used by Numen and the interface may change with Vosk or on a whim.

Contact

You can send questions, thoughts or patches by composing an email to ~geb/public-inbox@lists.sr.ht.

Support Me

Thank you!

License

AGPLv3 only, see LICENSE.

Copyright (c) 2022-2023 John Gebbie

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

func (r *Recognizer) Purge()

func (*Recognizer) Results

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

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
}

Jump to

Keyboard shortcuts

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