speaktome-node

0.2.0 • Public • Published

Speak To Me - Mozilla Speech Recognition API

Node.js module for SpeakToMe, Mozilla's Speech-to-text REST API.

Supports recording of audio on local system, encoding and sending the recording to Mozilla's service for processing, and retrieval of results.

Installation

Support for recording from system or USB mics is through the mic package, which depends on installation OS-specific recording utilities:

Windows and Mac OS X require SOX and Linux requires ALSA tools.

  • Windows: Download and install SOX from the website

  • Linux: sudo apt-get install alsa-base alsa-utils

  • Mac OS X: brew install sox

Install via npm:

 
npm install speaktome-node

Usage

var speech = require('speaktome-node');
 
speech.record().then(results => {
 
  // Results is an array of objects containing
  // `text` and `confidence` properties:
  //
  // [
  //   { confidence: "0.8090", text: "TEST" }
  // ]
  console.log(results);
 
}).catch(console.error);

Development Notes

Install opus-tools for command line utilities to test Opus encoding/decoding/playback

brew intall opus-tools

Command for encoding raw sound files recorded from system microphone to Opus

opusenc --raw --raw-rate 16000 --raw-chan 1 recording.raw recording.opus

Package Sidebar

Install

npm i speaktome-node

Weekly Downloads

2

Version

0.2.0

License

MPL-2.0

Unpacked Size

265 kB

Total Files

12

Last publish

Collaborators

  • dietrich