# voice-activity-detection

> Mic input activity detection

Latest version **0.0.5** (published 2017-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install voice-activity-detection
pnpm add voice-activity-detection
yarn add voice-activity-detection
bun add voice-activity-detection
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2017-12-17 |
| First published | 2016-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/voice-activity-detection) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vadim Namniak |
| Maintainers | namniak |
| Keywords | voice, voice activity, mic |

## Links

- npm: https://www.npmjs.com/package/voice-activity-detection
- Repository: https://github.com/Jam3/voice-activity-detection
- Issues: https://github.com/Jam3/voice-activity-detection/issues
- npm.io page: https://npm.io/package/voice-activity-detection

## Dependencies (1)

- [analyser-frequency-average](https://npm.io/package/analyser-frequency-average.md) ^1.0.0

## Recent versions

- 0.0.5 (latest) — 2017-12-17
- 0.0.4 — 2016-11-24
- 0.0.3 — 2016-10-18
- 0.0.2 — 2016-10-12
- 0.0.1 — 2016-10-12

## README

# voice-activity-detection

## Syntax
```vad(audioContext, stream [, options]);```

**Default options:**
```javascript
{
  fftSize: 1024,
  bufferLen: 1024,
  smoothingTimeConstant: 0.2,
  minCaptureFreq: 85,         // in Hz
  maxCaptureFreq: 255,        // in Hz
  noiseCaptureDuration: 1000, // in ms
  minNoiseLevel: 0.3,         // from 0 to 1
  maxNoiseLevel: 0.7,         // from 0 to 1
  avgNoiseMultiplier: 1.2,
  onVoiceStart: function() {},
  onVoiceStop: function() {},
  onUpdate: function(val) {}
}
```

* ```minCaptureFreq/maxCaptureFreq``` - human voice frequency range
* ```noiseCaptureDuration``` - time for measuring average env. noise before starting voice activity detection
* ```minNoiseLevel/maxNoiseLevel``` - env. noise level normalization range (during ```noiseCaptureDuration```)
* ```avgNoiseMultiplier``` - multiplier for the average env. noise level to set activity/inactivity state toggle

## Usage
See [example code](https://github.com/Jam3/voice-activity-detection/blob/master/test/test.js)

## Test
```npm run test```

---
_Source: https://npm.io/package/voice-activity-detection · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
