libfvad

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

This package provides voice activity detection (VAD) bindings for libfvad, which is the WebRTC VAD as a standalone library.

In order to use this package, you will need to build libfvad, which installs it with the other libraries:

% make libfvad

API Documentation Sources: https://github.com/dpirch/libfvad/blob/master/include/fvad.h

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context C.Fvad

func NewContext

func NewContext() *Context

NewContext returns a new VAD instance in MODE_QUALITY, with a sample rate of 8000 Hz, or nil if memory could not be allocated. It should be released with Free. A context isn't safe for concurrent use.

func (*Context) Free

func (context *Context) Free()

Free releases the VAD instance.

func (*Context) Process

func (context *Context) Process(frame []int16) (bool, error)

Process returns true if voice is detected in a frame of mono samples, which is 10, 20 or 30 ms long at the sample rate, so for example 160, 320 or 480 samples at 16000 Hz.

func (*Context) Reset

func (context *Context) Reset()

Reset clears all state, and resets the mode and sample rate to defaults.

func (*Context) SetMode

func (context *Context) SetMode(mode Mode) error

SetMode sets the operating ("aggressiveness") mode.

func (*Context) SetSampleRate

func (context *Context) SetSampleRate(rate int) error

SetSampleRate sets the input sample rate in Hz, which is one of 8000, 16000, 32000 or 48000. Processing is done at 8000 Hz, so input at higher sample rates is downsampled first.

type Error

type Error int

func (Error) Error

func (e Error) Error() string

type Mode

type Mode int
const (
	MODE_QUALITY         Mode = 0
	MODE_LOW_BITRATE     Mode = 1
	MODE_AGGRESSIVE      Mode = 2
	MODE_VERY_AGGRESSIVE Mode = 3
)

Modes, in increasing order of aggressiveness. A more aggressive mode is more restrictive in reporting speech, so is more likely to be right when it does, but misses more speech.

func (Mode) String

func (m Mode) String() string

Jump to

Keyboard shortcuts

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