voice

package
v0.0.0-...-23a661a Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AudioDevice = &audioDevice{}
View Source
var FlushData = make([]byte, 40000)

Speech server like VOSK waits for further data after stopped speaking Normall it takes 500ms ~ several seconds to return the result. I don't find any 'official' way of telling it not wait and return result immediately, So force it stop waiting by sending a chunk of 40k zeroes

Functions

This section is empty.

Types

type RecognitionEngine

type RecognitionEngine interface {
	Dial(host string) error
	Close() error

	SetCallback(func(string)) // callback will be invoked when got result from engine

	IsAlive() bool // websocket connection is alive

	SendText(text string) error
	SendBinary(data []byte) error
	SetPhraseList(phraseList []string) error
	Flush() error
}

type Vosk

type Vosk struct {
	// contains filtered or unexported fields
}

func (*Vosk) Close

func (v *Vosk) Close() error

func (*Vosk) Dial

func (v *Vosk) Dial(host string) error

func (*Vosk) Flush

func (v *Vosk) Flush() error

func (*Vosk) IsAlive

func (v *Vosk) IsAlive() bool

func (*Vosk) SendBinary

func (v *Vosk) SendBinary(data []byte) error

func (*Vosk) SendText

func (v *Vosk) SendText(text string) error

func (*Vosk) SetCallback

func (v *Vosk) SetCallback(cb func(string))

func (*Vosk) SetPhraseList

func (v *Vosk) SetPhraseList(phrase []string) error

The difference between SpeechModes is 'phrase_list' Set custom 'phrase_list' when entering new SpeechMode

Jump to

Keyboard shortcuts

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