webrtc-vad-0.1.0.2: Easy voice activity detection

Safe HaskellNone
LanguageHaskell2010

Sound.VAD.WebRTC

Synopsis

Documentation

data VAD s Source

A VAD instance with a state token (like MVector).

create :: PrimMonad m => m (VAD (PrimState m)) Source

Create and initialize a VAD instance.

type Aggressiveness = Int Source

Aggressiveness mode (0, 1, 2, or 3).

setMode :: PrimMonad m => Aggressiveness -> VAD (PrimState m) -> m () Source

setMode mode vad

Sets the VAD operating mode. A more aggressive (higher mode) VAD is more restrictive in reporting speech. Put in other words the probability of being speech when the VAD returns 1 is increased with increasing mode. As a consequence also the missed detection rate goes up.

validRateAndFrameLength :: Int -> Int -> Bool Source

validRateAndFrameLength rate frameLength

Checks for valid combinations of rate and frameLength. We support 10, 20 and 30 ms frames and the rates 8000, 16000 and 32000 Hz.

rate: Sampling frequency (Hz).

frameLength: Speech frame buffer length in number of samples.

process :: PrimMonad m => Int -> Vector Int16 -> VAD (PrimState m) -> m Bool Source

process sampleRate audioFrame vad

Calculates a VAD decision for the audioFrame. For valid sampling rates frame lengths, see the description of validRatesAndFrameLengths.

sampleRate: Sampling frequency (Hz): 8000, 16000, or 32000

audioFrame: Audio frame buffer (mono signed 16-bit).