Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data VAD s
- type IOVAD = VAD RealWorld
- create :: PrimMonad m => m (VAD (PrimState m))
- type Aggressiveness = Int
- setMode :: PrimMonad m => Aggressiveness -> VAD (PrimState m) -> m ()
- validRateAndFrameLength :: Int -> Int -> Bool
- process :: PrimMonad m => Int -> Vector Int16 -> VAD (PrimState m) -> m Bool
- newtype VADException = VADException String
Documentation
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).