Coder Social home page Coder Social logo

vitaly-z / whisper-onnx-speech-to-text Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexandr-janashvili/whisper-onnx-speech-to-text

0.0 0.0 0.0 4 KB

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

Home Page: https://www.npmjs.com/package/whisper-onnx-speech-to-text

JavaScript 44.95% TypeScript 55.05%

whisper-onnx-speech-to-text's Introduction

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

whisper-onnx-speech-to-text's People

Contributors

alexandr-janashvili avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.