Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

sonix-speech-recognition

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sonix-speech-recognition

A library that produces audio transcriptions and translations using the Sonix.AI service.

latest
Source
npmnpm
Version
2.1.1
Version published
Maintainers
1
Created
Source

sonix-speech-recognition

A library for producing audio transcriptions and translations using the Sonix AI service https://sonix.ai/.

Getting started

Install

npm install sonix-speech-recognition

Usage

Transcribe a publicly available file

import { SonixSpeechRecognitionService } from 'sonix-speech-recognition';

const recognitionService = new SonixSpeechRecognitionService(AUTH_KEY);
const { jobId, text, status, error } = await recognitionService.speechToText({
  audioUrl: audioPublicUrl,
  fileName,
  language: 'en',
});

if (status === 'failed') {
  // handle error
}

Transcribe a local file

import { SonixSpeechRecognitionService } from 'sonix-speech-recognition';

const recognitionService = new SonixSpeechRecognitionService(AUTH_KEY);
const { jobId, text, status, error } = await recognitionService.speechToText({
  audioFilePath,
  fileName,
  language: 'en',
});

if (status === 'failed') {
  // handle error
}

Transcribe and translate a local file

import { SonixSpeechRecognitionService } from 'sonix-speech-recognition';

const recognitionService = new SonixSpeechRecognitionService(AUTH_KEY);
const { jobId, text } = await recognitionService.speechToText({
  audioFilePath,
  fileName,
  language: 'en',
});

const {
  text: translatedText,
  status,
  error,
} = await sonixSpeechKitService.translateTranscription({
  transcriptionJobId: jobId,
  language: 'fr',
});

if (status === 'failed') {
  // handle error
}

Keywords

sonix

FAQs

Package last updated on 05 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts