Socket
Socket
Sign inDemoInstall

whisper-onnx-speech-to-text

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whisper-onnx-speech-to-text

Node.js plugin for speech recognition that works with OpenAI's Whisper models using ONNX.


Version published
Maintainers
1
Created
Source

whisper-onnx-speech-to-text

npm downloads npm downloads

Transcribe speech to text on node.js using OpenAI's Whisper models converted to cross-platform ONNX format

Installation

  1. Add dependency to project
npm install whisper-onnx-speech-to-text
  1. Download whisper model of choice
npx whisper-onnx-speech-to-text download

Usage

import { initWhisper } from 'whisper-onnx-speech-to-text';

const whisper = await initWhisper("base.en");

const transcript = await whisper.transcribe("example/sample.wav");

Result (JSON)

[
  {
    text: " And so my fellow Americans ask not what your country can do for you, ask what you can do for your country."
    chunks: [
       { timestamp: [0, 8.18],  text: " And so my fellow Americans ask not what your country can do for you" },
       { timestamp: [8.18, 11.06], text: " ask what you can do for your country." }
    ]
  }
]

API

initWhisper

The initWhisper() takes the name of the model and returns an instance of the Whisper class initialized with the chosen model.

Whisper

The Whisper class has the following methods:

  • transcribe(filePath: string, language?: string) : transcribes speech from wav file.
    • filePath: path to wav file
    • language: target language for recognition. Name format - the full name in English like 'spanish'
  • disposeModel() : dispose initialized model.

Made with

Keywords

FAQs

Package last updated on 26 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc