DEV Community

Cover image for Automatic Speech Recognition with Node.js
Dilek Karasoy for Picovoice

Posted on

4

Automatic Speech Recognition with Node.js

We'll cover how to run Automatic Speech Recognition (ASR) software with Node.js. Do you want to guess how many lines of code you need for it when you work with Leopard Node.js SDK?

  1. Create a project and install the SDK:
npm install @picovoice/leopard-node
Enter fullscreen mode Exit fullscreen mode
  1. Implement transcription in JavaScript Get your AccessKey from Picovoice Console if you haven't already. Then replace the placeholder with your AccessKey before running the below:
const {Leopard} = require("@picovoice/leopard-node");

const handle = new Leopard(accessKey);
Enter fullscreen mode Exit fullscreen mode
  1. Transcribe an audio file in FLAC, MP3, MP4, m4a, Ogg, WAV, and WebM.
const result = handle.processFile(audioPath);
console.log(result.transcript);
Enter fullscreen mode Exit fullscreen mode

Voila!

If you want to explore additional features such as word confidence or timestamps, check out this tutorial.

Top comments (0)

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay