@cityssm/whisper-speech-to-text
v0.2.1
Published
Locally converts recorded audio, like WAV files and MP3s, to text using OpenAI Whisper.
Readme
OpenAI Whisper for Node
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 ffmpegOn Debian-based Linux:
sudo apt-get install ffmpegOpenAI Whisper
Probably the easiest way to install Whisper is using the Python package manager,
pip.
pip install -U openai-whisperTo test your installation:
whisper --helpInstallation
npm install @cityssm/whisper-speech-to-textUsage
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'
})