Documentation ¶
Index ¶
- type Config
- type NullFloat
- type NullInt
- type PocketSphinx
- func (p *PocketSphinx) EndUtt() error
- func (p *PocketSphinx) Free()
- func (p *PocketSphinx) GetHyp(segment bool) (Result, error)
- func (p *PocketSphinx) GetInSpeech() bool
- func (p *PocketSphinx) GetNbest(numNbest int, segment bool) []Result
- func (p *PocketSphinx) ProcessRaw(raw []byte, noSearch, fullUtt bool) error
- func (p *PocketSphinx) ProcessUtt(raw []byte, numNbest int, segment bool) ([]Result, error)
- func (p *PocketSphinx) StartStream() error
- func (p *PocketSphinx) StartUtt() error
- type Result
- type Segment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type PocketSphinx ¶
type PocketSphinx struct { Config Config // contains filtered or unexported fields }
PocketSphinx is a speech recognition decoder object
func NewPocketSphinx ¶
func NewPocketSphinx(config Config) *PocketSphinx
NewPocketSphinx creates PocketSphinx instance with Config.
func (*PocketSphinx) EndUtt ¶
func (p *PocketSphinx) EndUtt() error
EndUtt ends utterance processing.
func (*PocketSphinx) Free ¶
func (p *PocketSphinx) Free()
Free releases all resources associated with the PocketSphinx.
func (*PocketSphinx) GetHyp ¶
func (p *PocketSphinx) GetHyp(segment bool) (Result, error)
GetHyp gets speech recognition result for best hypothesis. If segment is true, result contains word segments in recognized text.
func (*PocketSphinx) GetInSpeech ¶
func (p *PocketSphinx) GetInSpeech() bool
func (*PocketSphinx) GetNbest ¶
func (p *PocketSphinx) GetNbest(numNbest int, segment bool) []Result
func (*PocketSphinx) ProcessRaw ¶
func (p *PocketSphinx) ProcessRaw(raw []byte, noSearch, fullUtt bool) error
ProcessRaw processes a single channel, 16-bit pcm signal. if noSearch is true, ProcessRaw performs only feature extraction but don't do any recognition yet. if fullUtt is true, this block of data is a full utterance worth of data.
func (*PocketSphinx) ProcessUtt ¶
func (*PocketSphinx) StartStream ¶
func (p *PocketSphinx) StartStream() error
StartUtt starts utterance processing.
func (*PocketSphinx) StartUtt ¶
func (p *PocketSphinx) StartUtt() error
StartUtt starts utterance processing.
type Result ¶
type Result struct { Text string `json:"text"` Score int64 `json:"score"` Prob int64 `json:"prob"` Segments []Segment `json:"segments"` }
Result is a speech recognition result
type Segment ¶
type Segment struct { Word string `json:"word"` StartFrame int64 `json:"start_frame"` EndFrame int64 `json:"end_frame"` Prob int64 `json:"log_posterior_probability. "` AcScore int64 `json:"acoustic_score"` LmScore int64 `json:"languagemodel_score"` Lmbackoff int64 `json:"languagemodel_backoff"` }
Segment represents a word segment contains frame infomations and probabirity
func GetSegments ¶
func GetSegments(ps *C.ps_decoder_t) []Segment
GetSegments returns word segment list for best hypotesis
func GetSegmentsForNbest ¶
func GetSegmentsForNbest(nb *C.ps_nbest_t) []Segment
GetSegments returns word segment list for nbest_t