Socket
Socket
Sign inDemoInstall

node-speech-to-text

Package Overview
Dependencies
134
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-speech-to-text

Node module to convert speech to text using google services


Version published
Maintainers
1
Weekly downloads
4
decreased by-42.86%

Weekly downloads

Readme

Source

node-speech-to-text

This npm module captures the real time audio and internally uses Google Cloud Speech to Text Service. This is just a wrapper to provide more familiar methods to work with in NodeJS application

Google Cloud Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google’s machine learning technology.

Speech to Text Google Service Price - https://cloud.google.com/speech-to-text/pricing

Before you begin

  1. Sign in to your Google Account. If you don't already have one, sign up for a new account.
  2. Set up a GCP Console project. SET UP A PROJECT
    • Create or select a project.
    • Enable the Google Speech-to-Text API for that project.
    • Create a service account.
    • Download a private key as JSON. You can view and manage these resources at any time in the GCP Console.
  3. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the file path of the JSON file that contains your service account key. This variable only applies to your current shell session, so if you open a new session, set the variable again.
    • Example: Linux or macOS
      • export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"
    • Example: Windows
      • $env:GOOGLE_APPLICATION_CREDENTIALS="C:\Users\username\Downloads\[FILE_NAME].json"

For Recording/Listening To Real Time Audio Stream

We have used node-record-lpcm-16. Records a 16-bit signed-integer linear pulse modulation code WAV audio file.

This module uses Node.js streams to minimize memory usage and optimize speed, perfect for embedded devices and "the internet of things".

These audio files are fully compatible with both the Google Speech to Text API (v2) and the Wit.ai Speech API.

Dependencies

This module requires you to install SoX and it must be available in your $PATH.

For Mac OS

brew install sox

For most linux disto's

sudo apt-get install sox libsox-fmt-all

For Windows

download the binaries

Usage

var speechToText = require('node-speech-to-text');

speechToText.speechToTextRealTimeTranscription();

or

speechToText.speechToTextRealTimeTranscription(encodingParam, sampleRateHertzParam, languageCodeParam, interimResultsParam);

Keywords

FAQs

Last updated on 15 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc