Web Library Introduction

Soniox Web Voice is a Javascript client library that enables you to integrate with Soniox API service directly from your web application. In just a few lines of code, you can do real-time and low-latency automatic speech recognition with various configurations. See a complete example below.

For complete documentation of the Soniox Web Voice library, see the API Reference page.

See Soniox Web Voice GitHub repository.


This example demonstrates how to do live transcription from a microphone using Soniox Web Voice library in a webpage or a web application. It contains a simple user interface to start, stop or cancel live transcriptions from the microphone.

To try it out, download the example.html file, set your API key in the example.html and open the example.html in your browser.


1. Include Javascript package

Include Soniox Web Voice Javascript package in your HTML page. The package includes functionality for capturing audio from your microphone and communication with Soniox API service.

<script src="https://js.soniox.com/soniox-web-voice.js"></script>
Always load soniox-web-voice.js from https://js.soniox.com. You should not include it in a bundle or self-host it.

2. Transcribe

The code creates the RecordTranscribe object, which simultaneously (1) captures the audio from your microphone, (2) transcribes the audio using Soniox speech recognition service, and (3) prints recognized words into web console.

Make sure to set your API key, which you can find under API Keys tab for a given project in Soniox Console.


// Set your API key.
let apikey = "<YOUR-API-KEY>";

// Create RecordTranscribe object.
let recordTranscribe = new sonioxWebVoice.RecordTranscribe()

// Set event handler.

function printWords(result) {
    for (let i = 0; i < result.words.length; ++i) {

// Start transcribing from your microphone.
cookie Change your cookie preferences