JavaScript speech recognition libraries

Updated Nov 2026

JavaScript speech recognition libraries turn recorded or live audio into text. Most send the audio to a cloud speech-to-text service that returns a transcript with timestamps and speaker labels. These libraries let voice agents, meeting tools, and captioning apps act on what people say.

Popularity

The ElevenLabs JavaScript SDK has the most monthly downloads in this comparison, at 5.7M, a count that covers every ElevenLabs API rather than speech recognition alone.

LibraryMonthly downloadsStarsLast releaseLicense
@elevenlabs/elevenlabs-js
5.7M
456Nov 2026MIT
Deepgram JavaScript SDK
5.3M
286Nov 2026MIT
Google Cloud Speech
3.5M
3.2KOct 2026Apache-2.0
@aws-sdk/client-transcribe
3.4M
3.7KNov 2026Apache-2.0
AssemblyAI
2.9M
77Nov 2026MIT
microsoft-cognitiveservices-speech-sdk
2.7M
327Oct 2026MIT
@aws-sdk/client-transcribe-streaming
2.1M
3.7KNov 2026Apache-2.0
react-speech-recognition
1.1M
843Apr 2025MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

@elevenlabs/elevenlabs-js

Provides the official JavaScript library for the ElevenLabs API.

Downloads / mo
5.7M
Stars
456
Last release
2.79.0
License
MIT

Quickstart

From example.mts
$ npm install @elevenlabs/elevenlabs-js@2.79.0
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
const client = new ElevenLabsClient();
const audio = await fetch("https://storage.googleapis.com/eleven-public-cdn/audio/marketing/nicole.mp3");
const transcript = await client.speechToText.convert({
  file: new Blob([await audio.arrayBuffer()], { type: "audio/mp3" }),
  modelId: "scribe_v3",
});
console.log(transcript);

Deepgram JavaScript SDK

Provides the official JavaScript SDK for Deepgram.

Downloads / mo
5.3M
Stars
286
Last release
5.20.0
License
MIT

Quickstart

From README.md
$ npm install @deepgram/sdk@5.20.0
import { createReadStream } from "node:fs";
import { DeepgramClient } from "@deepgram/sdk";
const client = new DeepgramClient();
const response = await client.listen.v1.media.transcribeFile(
  createReadStream("audio.wav"), { model: "nova-3" }
);
console.log(response.results.channels[0].alternatives[0].transcript);

Google Cloud Speech

Recognizes speech through Google Cloud's Node.js client.

Downloads / mo
3.5M
Stars
3.2K
Last release
8.2.1
License
Apache-2.0

Strengths

  • Processes recordings asynchronously. Use longRunningRecognize to retrieve a transcript when processing finishes.
  • Returns speaker-tagged words. Enable diarization to attach speaker labels to recognized words.

Limitations

  • Streaming requires gRPC. Route live audio through a gRPC-capable Node backend.

Quickstart

From quickstart.js
$ npm install @google-cloud/speech@8.2.1
import { SpeechClient } from "@google-cloud/speech";
const client = new SpeechClient();
const [response] = await client.recognize({
  audio: { uri: process.env.AUDIO_GCS_URI },
  config: { encoding: "LINEAR16", sampleRateHertz: 16000, languageCode: "en-US" },
});
console.log(response.results?.map(result => result.alternatives?.[0]?.transcript));

Google Cloud Speech examples

From open-source projects on GitHub

@aws-sdk/client-transcribe

Provides the AWS SDK client for Amazon Transcribe in Node.js, browsers, and React Native.

Downloads / mo
3.4M
Stars
3.7K
Last release
3.1172.0
License
Apache-2.0
$ npm install @aws-sdk/client-transcribe@3.1172.0
import { TranscribeClient, StartTranscriptionJobCommand } from "@aws-sdk/client-transcribe";
const client = new TranscribeClient({ region: process.env.AWS_REGION });
const response = await client.send(new StartTranscriptionJobCommand({
  TranscriptionJobName: process.env.TRANSCRIPTION_JOB_NAME,
  LanguageCode: "en-US",
  Media: { MediaFileUri: process.env.AUDIO_S3_URI },
}));
console.log(response.TranscriptionJob);

@aws-sdk/client-transcribe examples

From open-source projects on GitHub

Provides JavaScript interfaces for asynchronous and streaming transcription.

Downloads / mo
2.9M
Stars
77
Last release
4.43.4
License
MIT

Strengths

  • Waits for completed file transcripts. transcribe submits the job and polls until it finishes.
  • Returns speaker-labeled utterances. Set speaker_labels to group the transcript by speaker.

Limitations

  • Synchronous word timings are opt-in. Set timestamps to true when the synchronous transcript needs timings.
  • Browser streaming needs token setup. Create a temporary streaming token on a server.

Quickstart

From README.md
$ npm install assemblyai@4.43.4
import { AssemblyAI } from "assemblyai";
const client = new AssemblyAI({ apiKey: process.env.ASSEMBLYAI_API_KEY });
const transcript = await client.transcripts.transcribe({
  audio: "https://assembly.ai/sports_injuries.mp3",
  speech_models: ["universal-3-5-pro", "universal-2"],
  language_detection: true,
});
console.log(transcript.text);

AssemblyAI examples

From open-source projects on GitHub
protected async transcribeOrGetTranscript(params: TranscribeParams | string) {
    const client = await this.clientPromise;
    if (typeof params === "string") {
      return await client.transcripts.get(params);
    } else {
      return await client.transcripts.transcribe(params);
    }
  }

microsoft-cognitiveservices-speech-sdk

Provides browser and Node.js interfaces to Microsoft's Speech SDK.

Downloads / mo
2.7M
Stars
327
Last release
1.53.0
License
MIT

Strengths

  • Accepts browser microphone input. Build a browser recognizer with AudioConfig.fromDefaultMicrophoneInput.
  • Separates intermediate and final results. Use recognizing and recognized to handle tentative and final text.

Limitations

  • Node microphone input is unsupported. Feed a file or audio stream to the Node recognizer.
  • recognizeOnceAsync stops after one utterance. Use continuous recognition for sessions containing multiple utterances.

Quickstart

From index.js
$ npm install microsoft-cognitiveservices-speech-sdk@1.53.0
import * as speech from "microsoft-cognitiveservices-speech-sdk";
const authorizationToken = "YOUR_AUTHORIZATION_TOKEN";
const region = "YOUR_AZURE_REGION";
const config = speech.SpeechConfig.fromAuthorizationToken(authorizationToken, region);
const audio = speech.AudioConfig.fromDefaultMicrophoneInput();
const recognizer = new speech.SpeechRecognizer(config, audio);
recognizer.recognizeOnceAsync(
  result => { console.log(result.text); recognizer.close(); },
  error => { console.error(error); recognizer.close(); }
);

microsoft-cognitiveservices-speech-sdk examples

From open-source projects on GitHub
private generateSpeechRecognizer(token: string, region: string) {
        const speechConfig = speechSdk.SpeechConfig.fromAuthorizationToken(token, region);
        speechConfig.speechRecognitionLanguage = 'en-US';
        const audioConfig = speechSdk.AudioConfig.fromDefaultMicrophoneInput();
        return new speechSdk.SpeechRecognizer(speechConfig, audioConfig);
    }

@aws-sdk/client-transcribe-streaming

Provides the JavaScript client for Amazon Transcribe streaming.

Downloads / mo
2.1M
Stars
3.7K
Last release
3.1172.0
License
Apache-2.0

Strengths

  • Streams partial and final transcripts. Read IsPartial before committing transcript segments to application state.
  • Runs in browser or Node. Use WebSocket in browsers and HTTP/2 in Node.

Limitations

  • Sample rate must match audio. Set MediaSampleRateHertz to the stream's actual sample rate.
  • Partial transcripts can change. Replace tentative text until IsPartial becomes false.

Quickstart

From transcribeClient.js
$ npm install @aws-sdk/client-transcribe-streaming@3.1172.0
import { createReadStream } from "node:fs";
import { TranscribeStreamingClient, StartStreamTranscriptionCommand } from "@aws-sdk/client-transcribe-streaming";
const client = new TranscribeStreamingClient({ region: process.env.AWS_REGION });
async function* audio() {
  for await (const chunk of createReadStream("audio.pcm", { highWaterMark: 3200 }))
    yield { AudioEvent: { AudioChunk: chunk } };
}
const response = await client.send(new StartStreamTranscriptionCommand({
  LanguageCode: "en-US", MediaEncoding: "pcm", MediaSampleRateHertz: 16000, AudioStream: audio(),
}));
for await (const event of response.TranscriptResultStream ?? []) console.log(event.TranscriptEvent);

@aws-sdk/client-transcribe-streaming examples

From open-source projects on GitHub

react-speech-recognition

Adds browser speech recognition to React apps.

Downloads / mo
1.1M
Stars
843
Last release
4.0.1
License
MIT

Quickstart

From API.md
$ npm install react-speech-recognition@4.0.1
import SpeechRecognition, { useSpeechRecognition } from "react-speech-recognition";
export default function Dictation() {
  const { transcript, browserSupportsSpeechRecognition } = useSpeechRecognition();
  if (!browserSupportsSpeechRecognition) return <p>Speech recognition is unavailable.</p>;
  return <>
    <button onClick={() => SpeechRecognition.startListening()}>Start</button>
    <button onClick={() => SpeechRecognition.stopListening()}>Stop</button>
    <p>{transcript}</p>
  </>;
}

react-speech-recognition examples

From open-source projects on GitHub

FAQ

The speech service decides the library. Deepgram, AssemblyAI, and ElevenLabs offer SDKs for prerecorded and live transcription. react-speech-recognition suits React apps that use the browser's own speech recognition.

Speaker diarization labels which speaker said each part of a transcript. Every cloud SDK in this comparison except react-speech-recognition returns speaker labels.

The Web Speech API is the browser's built-in speech recognition interface. react-speech-recognition wraps it in a React hook that returns the transcript and reports browser support.

Both Deepgram and AssemblyAI offer JavaScript SDKs for prerecorded and live audio with speaker labels. A test on the app's own recordings shows which service transcribes them better.

A streaming SDK sends audio chunks over an open connection and returns partial transcripts as the speaker talks. AWS Transcribe Streaming, Microsoft Speech SDK, and AssemblyAI support live audio.

For coding agents

Found your speech recognition library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official