Web Voice Get Started

1. Include Soniox Javascript package

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

<script src="https://js.soniox.com/soniox-web-voice.js"></script>

Always load soniox-web-voice.js from https://js.soniox.com. You can not include it in a bundle or self-host it.

2. Try It Out

This example demonstrates how to use Soniox speech recognition for live transcription of audio from your microphone. You can copy/paste the code in your HTML page.

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.

There is a 30 seconds per session limit with Soniox Free Speech Recognition.

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

// Set event handler.
recordTranscribe.setOnPartialResult(printWords)

function printWords(result) {
    for (let i = 0; i < result.words.length; ++i) {
      console.log(result.words[i]);
    }
}

// Start transcribing from your microphone.
recordTranscribe.start()
</script>

Integrate Web Voice

Check out our Web Voice Example with a simple user interface to start, stop or cancel live transcriptions from the microphone. To integrate speech recognition into your website or web application, copy/paste the source code from this example and it will just work.