npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-speech-to-text

v1.0.0

Published

Node module to convert speech to text using google services

Downloads

7

Readme

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);