vad

package
v0.55.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Mode vad mode,VAD 的模式 0-3
	Mode = 3
	// FrameDuration frame duration,分析的时间窗口
	FrameDuration = 10
)

Variables

This section is empty.

Functions

func GetAudioIndex2Time

func GetAudioIndex2Time(index int) float64

GetAudioIndex2Time 从 Audio 的 OffsetIndex 推算出它所在的时间,返回 float64 的秒

func GetFloatSlice

func GetFloatSlice(inVADs []VADInfo, skipFrontAndEndPerBase float64) []float64

GetFloatSlice 返回 1 -1 归一化的数组

Types

type AudioInfo

type AudioInfo struct {
	FileFullPath string
	SampleRate   int
	BitDepth     int
}

type VADInfo

type VADInfo struct {
	Frame  int           // 第几帧
	Offset int           // 音频的偏移
	Active bool          // 当前帧(时间窗口)是否检测到语音
	Time   time.Duration // 时间点
}

func GetVADInfoFromAudio

func GetVADInfoFromAudio(audioInfo AudioInfo, insert bool) ([]VADInfo, error)

GetVADInfoFromAudio 分析音频文件,得到 VAD 分析信息,看样子是不支持并发的,只能单线程使用 无需使用插值的函数

func NewVADInfo

func NewVADInfo(frame, offset int, active bool, nowTime time.Duration) *VADInfo

func NewVADInfoBase

func NewVADInfoBase(active bool, nowTime time.Duration) *VADInfo

Jump to

Keyboard shortcuts

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