npm.io
0.2.2 • Published 21h ago

@cityssm/whisper-speech-to-text

Licence
MIT
Version
0.2.2
Deps
1
Size
19 kB
Vulns
0
Weekly
0

OpenAI Whisper for Node

DeepSource codecov

Locally converts recorded audio, like WAV files and MP3s, to text using OpenAI Whisper.

Prerequisites

Like other Node wrappers around OpenAI Whisper, this package requires a few tools to work.

Python

Download from the official Python website. For best results, make sure to add Python to the path.

FFmpeg

For audio processing.

On Windows via Chocolatey:

choco install ffmpeg

On Debian-based Linux:

sudo apt-get install ffmpeg
OpenAI Whisper

Probably the easiest way to install Whisper is using the Python package manager, pip.

pip install -U openai-whisper

To test your installation:

whisper --help

Installation

npm install @cityssm/whisper-speech-to-text

Usage

import speechToText from '@cityssm/whisper-speech-to-text'

const basicTranscription = await speechToText('path/to/audioFile.mp3')

const transcriptionWithOptions = await speechToText('path/to/audioFile.wav', {
  whisperPath: 'path/to/whisper',
  model: 'large',
  language: 'en'
})

Keywords