Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@pr0gramm/fluester
Advanced tools
Node.js bindings for OpenAI's Whisper. Hard-fork of whisper-node.
make
and everything else listed as required to compile whisper.cppnpm install @pr0gramm/fluester
npx --package @pr0gramm/fluester download-model
npx --package @pr0gramm/fluester compile-whisper
Important: The API only supports WAV files (just like the original whisper.cpp). You need to convert any files to a supported format before. You can do this using ffmpeg (example taken from the whisper project):
ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav
import { createWhisperClient } from "@pr0gramm/fluester";
const client = createWhisperClient({
modelName: "base",
});
const transcript = await client.translate("example/sample.wav");
console.log(transcript); // output: [ {start,end,speech} ]
[
{
"start": "00:00:14.310", // timestamp start
"end": "00:00:16.480", // timestamp end
"speech": "howdy" // transcription
}
]
import { createWhisperClient } from "@pr0gramm/fluester";
const client = createWhisperClient({
modelName: "base",
});
const result = await client.detectLanguage("example/sample.wav");
if(!result) {
console.log(`Detected: ${result.language} with probability ${result.probability}`);
} else {
console.log("Did not detect anything :(");
}
You cannot use any file for processing, as whisper needs a special encoded wav file. This package ships a helper function that invokes the required ffmpeg commands, so you can convert your files easily:
import { convertFileToProcessableFile } from "@pr0gramm/fluester";
const inputFile = "...";
const outputFile = "output.wav";
await convertFileToProcessableFile(inputFile, outputFile);
// ...
await client.detectLanguage(outputFile);
This library is designed to work well in dockerized environments.
We took time and made some steps independent from each other, so they can be used in a multi-stage docker build.
FROM node:latest as dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
RUN npx --package @pr0gramm/fluester compile-whisper
RUN npx --package @pr0gramm/fluester download-model tiny
FROM node:latest
WORKDIR /app
COPY --from=dependencies /app/node_modules /app/node_modules
COPY ./ ./
This includes the model in the image. If you want to keep your image small, you can also download the model in your entrypoint using the commands above.
FAQs
Node.js bindings for OpenAI's Whisper. Optimized for CPU.
The npm package @pr0gramm/fluester receives a total of 1,216 weekly downloads. As such, @pr0gramm/fluester popularity was classified as popular.
We found that @pr0gramm/fluester demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.