Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToIntVAD ¶
func BytesToSamples ¶
Types ¶
type SpeechRequest ¶
type SpeechRequest struct { Device string Session string FirstReq []byte Stream interface{} IsKG bool IsIG bool MicData []byte DecodedMicData []byte PrevLen int PrevLenRaw int InactiveFrames int ActiveFrames int VADInst *webrtcvad.VAD LastAudioChunk []byte IsOpus bool OpusStream *opus.OggStream }
func ReqToSpeechRequest ¶
func ReqToSpeechRequest(req interface{}) SpeechRequest
Converts a vtt.*Request to a SpeechRequest, which allows functions like DetectEndOfSpeech to work
func (*SpeechRequest) DetectEndOfSpeech ¶
func (req *SpeechRequest) DetectEndOfSpeech() bool
Uses VAD to detect when the user stops speaking
func (*SpeechRequest) GetNextStreamChunk ¶
func (req *SpeechRequest) GetNextStreamChunk() ([]byte, error)
Returns the next chunk in the stream as 16000 Hz PCM
func (*SpeechRequest) GetNextStreamChunkOpus ¶
func (req *SpeechRequest) GetNextStreamChunkOpus() ([]byte, error)
Returns next chunk in the stream as whatever the original format is (OPUS 99% of the time)
func (*SpeechRequest) OpusDecode ¶
func (req *SpeechRequest) OpusDecode(chunk []byte) []byte
func (*SpeechRequest) OpusDetect ¶
func (req *SpeechRequest) OpusDetect() bool
Click to show internal directories.
Click to hide internal directories.