hear

package module
v0.0.0-...-33d3053 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 12 Imported by: 0

README

hear

A Go package that uses PortAudio and Google's Speech-to-Text API to provide live recognition of human mouth sounds.

Documentation

Index

Constants

View Source
const DefaultQuietTime = time.Second

Variables

This section is empty.

Functions

func FreeAudio

func FreeAudio()

func InitAudio

func InitAudio()

func ListenIntoBuffer

func ListenIntoBuffer(opts ListenOpts) (*bytes.Buffer, error)

Types

type GCPSpeechConv

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

func NewGCPSpeechConv

func NewGCPSpeechConv(accountFile string) (*GCPSpeechConv, error)

func (*GCPSpeechConv) Convert

func (gcp *GCPSpeechConv) Convert(data []byte) (string, error)

type ListenOpts

type ListenOpts struct {
	State            func(State)
	QuietDuration    time.Duration
	AlreadyListening bool
}

type State

type State int
const (
	Waiting State = iota
	Listening
	Asking
)

type VAD

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

func NewVAD

func NewVAD(width int) *VAD

func (*VAD) FFT

func (v *VAD) FFT() []complex128

func (*VAD) Flux

func (v *VAD) Flux(samples []int16) float64

Given the samples, return the spectral flux value as compared to the previous samples.

Directories

Path Synopsis
cmd
hear command
For the most part, these bindings parallel the underlying PortAudio API; please refer to http://www.portaudio.com/docs.html for details.
For the most part, these bindings parallel the underlying PortAudio API; please refer to http://www.portaudio.com/docs.html for details.

Jump to

Keyboard shortcuts

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