Skip to main content

Sonix Audio


Only available on Node.js.

This covers how to load document objects from an audio file using the Sonix API.


To run this loader you will need to create an account on the and obtain an auth key from the page.

You'll also need to install the sonix-speech-recognition library:

npm install sonix-speech-recognition


Once auth key is configured, you can use the loader to create transcriptions and then convert them into a Document. In the request parameter, you can either specify a local file by setting audioFilePath or a remote file using audioUrl. You will also need to specify the audio language. See the list of supported languages here.

import { SonixAudioTranscriptionLoader } from "langchain/document_loaders/web/sonix_audio";

const loader = new SonixAudioTranscriptionLoader({
sonixAuthKey: "SONIX_AUTH_KEY",
request: {
fileName: "FILE_NAME",
language: "en",

const docs = await loader.load();


API Reference:

Help us out by providing feedback on this documentation page: