Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-whisper

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-whisper

A binding for OpenAI's Whisper Speech-to-Text system, supporting async operations.

  • 2024.11.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

node-whisper

NPM

node-whisper is a powerful and straightforward TypeScript package that provides seamless integration with OpenAI's Whisper Speech-to-Text system. If you're looking to harness the incredible capabilities of Whisper for your projects, you're in the right place.

Before You Begin:

Make sure you've got your foundation set by following the instructions laid out in the OpenAI Whisper repository. Once you've completed those steps, you're ready to dive in.

Installation

To add node-whisper to your project, simply run:

npm install node-whisper

Or with yarn

yarn add node-whisper

Getting Started

import whisper from 'node-whisper';

async function transcribeAudio() {
  try {
    const audioFilePath = 'path_to_your_audio_file.wav';
    const data = await whisper(audioFilePath, {
      output_format: 'all',
      output_dir: 'subtitles',
    });
    console.log('Transcriptions:', data); // all the selected files paths (default: json, tsv, srt, txt, vtt)
    const JSONcontent = await data.json.getContent();
    console.log(JSONcontent); // the content of the file
    // or if you provide all output_format and you want to read them all at once
    const contents = await whisper.readAllFiles(data);
    console.log(contents); // all the returned files parsed
  } catch (error) {
    console.error('Error:', error.message);
  }
}

transcribeAudio();

Features

Async Support: Embrace the asynchronous nature of modern JavaScript and take full advantage of async/await when interacting with Whisper.

Comprehensive Options: All of Whisper's configuration options are supported, giving you fine-grained control over your Speech-to-Text tasks.

Typescript Support: Enjoy the benefits of static typing and enhanced code readability when working with node-whisper in TypeScript with both esm and cjs modules.

No dependencies.

Happy coding!

Keywords

FAQs

Package last updated on 12 Nov 2024

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc