All Projects → Picovoice → web-voice-processor

Picovoice / web-voice-processor

Licence: Apache-2.0 license
A library for real-time voice processing in web browsers

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to web-voice-processor

revai-node-sdk
Node.js SDK for the Rev AI API
Stars: ✭ 21 (-69.57%)
Mutual labels:  realtime, speech-recognition, speech-to-text
Rhino
On-device speech-to-intent engine powered by deep learning
Stars: ✭ 406 (+488.41%)
Mutual labels:  voice-commands, speech-recognition, speech-to-text
Discordspeechbot
A speech-to-text bot for discord with music commands and more using NodeJS. Ideally for controlling your Discord server using voice commands, can also be useful for hearing-impaired people.
Stars: ✭ 35 (-49.28%)
Mutual labels:  voice-commands, speech-recognition, speech-to-text
musicologist
Music advice from a conversational interface powered by Algolia
Stars: ✭ 19 (-72.46%)
Mutual labels:  voice-commands, speech-recognition, speech-to-text
react-native-spokestack
Spokestack: give your React Native app a voice interface!
Stars: ✭ 53 (-23.19%)
Mutual labels:  voice-commands, speech-recognition, speech-to-text
voce-browser
Voice Controlled Chromium Web Browser
Stars: ✭ 34 (-50.72%)
Mutual labels:  speech-recognition, web-browser, speech-to-text
Artyom.js
A voice control - voice commands - speech recognition and speech synthesis javascript library. Create your own siri,google now or cortana with Google Chrome within your website.
Stars: ✭ 1,011 (+1365.22%)
Mutual labels:  voice-commands, speech-recognition, speech-to-text
Audio Pretrained Model
A collection of Audio and Speech pre-trained models.
Stars: ✭ 61 (-11.59%)
Mutual labels:  speech-recognition, speech-to-text, audio-processing
KeenASR-Android-PoC
A proof-of-concept app using KeenASR SDK on Android. WE ARE HIRING: https://keenresearch.com/careers.html
Stars: ✭ 21 (-69.57%)
Mutual labels:  voice-commands, speech-recognition, speech-to-text
revai-python-sdk
Rev AI Python SDK
Stars: ✭ 35 (-49.28%)
Mutual labels:  realtime, speech-recognition, speech-to-text
Rhasspy
Offline private voice assistant for many human languages
Stars: ✭ 458 (+563.77%)
Mutual labels:  voice-commands, speech-recognition
Alan Sdk Pcf
Alan AI Power Apps SDK adds a voice assistant or chatbot to your Microsoft Power Apps project.
Stars: ✭ 128 (+85.51%)
Mutual labels:  voice-commands, speech-recognition
Porcupine
On-device wake word detection powered by deep learning.
Stars: ✭ 2,606 (+3676.81%)
Mutual labels:  voice-commands, wake-word-detection
megs
A merged version of multiple open-source German speech datasets.
Stars: ✭ 21 (-69.57%)
Mutual labels:  speech-recognition, speech-to-text
Alan Sdk Web
Alan AI Web SDK adds a voice assistant or chatbot to your app. Supports React, Angular, Vue, Ember, JavaScript, Electron.
Stars: ✭ 368 (+433.33%)
Mutual labels:  voice-commands, speech-recognition
netpd-instruments
instruments (synths, sequencers, utilities, etc) to be used with netpd
Stars: ✭ 18 (-73.91%)
Mutual labels:  realtime, audio-processing
anycontrol
Voice control for your websites and applications
Stars: ✭ 53 (-23.19%)
Mutual labels:  speech-recognition, speech-to-text
Aurio
Audio Fingerprinting & Retrieval for .NET
Stars: ✭ 84 (+21.74%)
Mutual labels:  realtime, audio-processing
leopard
On-device speech-to-text engine powered by deep learning
Stars: ✭ 354 (+413.04%)
Mutual labels:  speech-recognition, speech-to-text
revai-java-sdk
Rev.ai Java SDK
Stars: ✭ 16 (-76.81%)
Mutual labels:  speech-recognition, speech-to-text

Web Voice Processor

GitHub release

Made in Vancouver, Canada by Picovoice

A library for real-time voice processing in web browsers.

Browser compatibility

All modern browsers (Chrome/Edge/Opera, Firefox, Safari) are supported, including on mobile. Internet Explorer is not supported.

Using the Web Audio API requires a secure context (HTTPS connection), with the exception of localhost, for local development.

This library includes the utility function browserCompatibilityCheck which can be used to perform feature detection on the current browser and return an object indicating browser capabilities.

ESM:

import { browserCompatibilityCheck } from '@picovoice/web-voice-processor';
browserCompatibilityCheck();

IIFE:

window.WebVoiceProcessor.browserCompatibilityCheck();

Browser features

  • '_picovoice' : whether all Picovoice requirements are met
  • 'AudioWorklet' (not currently used; intended for the future)
  • 'isSecureContext' (required for microphone permission for non-localhost)
  • 'mediaDevices' (basis for microphone enumeration / access)
  • 'WebAssembly' (required for all Picovoice engines)
  • 'webKitGetUserMedia' (legacy predecessor to getUserMedia)
  • 'Worker' (required for resampler and for all engine processing)

Installation

npm install @picovoice/web-voice-processor

(or)

yarn add @picovoice/web-voice-processor

How to use

Via ES Modules (Create React App, Angular, Webpack, etc.)

import { WebVoiceProcessor } from '@picovoice/web-voice-processor';

Via HTML script tag

Add the following to your HTML:

<script src="@picovoice/web-voice-processor/dist/iife/index.js"></script>

The IIFE version of the library adds WebVoiceProcessor to the window global scope.

Start listening

WebVoiceProcessor follows the subscribe/unsubscribe pattern. WebVoiceProcessor will automatically start recording audio as soon as an engine is subscribed.

const worker = new Worker('${WORKER_PATH}');
const engine = {
  onmessage: function(e) {
    /// ... handle inputFrame
  }
}

await WebVoiceProcessor.subscribe(engine);
await WebVoiceProcessor.subscribe(worker);
// or
await WebVoiceProcessor.subscribe([engine, worker]);

An engine is either a Web Workers or an object implementing the following interface within their onmessage method:

onmessage = function (e) {
    switch (e.data.command) {
        case 'process':
            process(e.data.inputFrame);
            break;
    }
};

where e.data.inputFrame is an Int16Array of frameLength audio samples.

For examples of using engines, look at src/engines.

This is async due to its Web Audio API microphone request. The promise will be rejected if the user refuses permission, no suitable devices are found, etc. Your calling code should anticipate the possibility of rejection. When the promise resolves, the WebVoiceProcessor is running.

Stop Listening

Unsubscribing the engines initially subscribed will stop audio recorder.

await WebVoiceProcessor.unsubscribe(engine);
await WebVoiceProcessor.unsubscribe(worker);
//or
await WebVoiceProcessor.unsubscribe([engine, worker]);

Reset

Use the reset function to remove all engines and stop recording audio.

await WebVoiceProcessor.reset();

Options

To update the audio settings in WebVoiceProcessor, use the setOptions function:

// Override default options
let options = {
  frameLength: 512,
  outputSampleRate: 16000,
  deviceId: null,
  filterOrder: 50
};

WebVoiceProcessor.setOptions(options);

VuMeter

WebVoiceProcessor includes a built-in engine which returns the VU meter. To capture the VU meter value, create a VuMeterEngine instance and subscribe it to the engine:

function vuMeterCallback(dB) {
  console.log(dB)
}

const vuMeterEngine = new VuMeterEngine(vuMeterCallback);
WebVoiceProcessor.subscribe(vuMeterEngine);

The vuMeterCallback should expected a number in terms of dBFS within the range of [-96, 0].

Build from source

Use yarn or npm to build WebVoiceProcessor:

yarn
yarn build

(or)

npm install
npm run-script build

The build script outputs minified and non-minified versions of the IIFE and ESM formats to the dist folder. It also will output the TypeScript type definitions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].