fluester – [ˈflʏstɐ]
Node.js bindings for OpenAI's Whisper. Hard-fork of whisper-node.
Features
- Output transcripts to JSON (also .txt .srt .vtt)
- Optimized for CPU (Including Apple Silicon ARM)
- Timestamp precision to single word
Installation
Requirements
make
and everything else listed as required to compile whisper.cpp- Node.js >= 20
- Add dependency to project
npm install @pr0gramm/fluester
- Download whisper model of choice
npx --package @pr0gramm/fluester download-whisper
- Compile whisper.cpp if you don't want to provide you own version:
npx --package @pr0gramm/fluester compile-whisper
Usage
import { createWhisperClient } from "@pr0gramm/fluester";
const client = createWhisperClient();
const transcript = await client.translate("example/sample.wav");
console.log(transcript);
Output (JSON)
[
{
"start": "00:00:14.310",
"end": "00:00:16.480",
"speech": "howdy"
}
]
Usage with Additional Options
import whisper from "@pr0gramm/fluester";
const filePath = "example/sample.wav",
const options = {
modelName: "tiny.en",
modelPath: "/custom/path/to/model.bin",
whisperOptions: {
generateTxt: false,
generateSubtitles: false,
generateVtt: false,
timestampSize: 10,
wordTimestamps: true
}
}
const transcript = await whisper(filePath, options);
Made with
Roadmap