DEV Community

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

Posted on

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.

Oldest comments (0)