
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
nodejs-whisper
Advanced tools
Node.js bindings for OpenAI's Whisper model.
sudo apt update
sudo apt install build-essential
npm i nodejs-whisper
npx nodejs-whisper download
Install MinGW-w64 or MSYS2 (which includes make tools)
Install nodejs-whisper with npm
npm i nodejs-whisper
npx nodejs-whisper download
See example/index.ts (can be run with $ npm run test)
import path from 'path'
import { nodewhisper } from 'nodejs-whisper'
// Need to provide exact path to your audio file.
const filePath = path.resolve(__dirname, 'YourAudioFileName')
await nodewhisper(filePath, {
modelName: 'base.en', //Downloaded models name
modelRootPath: '/path/to/whisper/models', // (optional) directory containing the selected ggml model file
autoDownloadModelName: 'base.en', // (optional) auto download a model if model is not present
removeWavFileAfterTranscription: false, // (optional) remove wav file once transcribed
withCuda: false, // (optional) use cuda for faster processing
logger: console, // (optional) Logging instance, defaults to console
whisperOptions: {
outputInCsv: false, // get output result in csv file
outputInJson: false, // get output result in json file
outputInJsonFull: false, // get output result in json file including more information
outputInLrc: false, // get output result in lrc file
outputInSrt: true, // get output result in srt file
outputInText: false, // get output result in txt file
outputInVtt: false, // get output result in vtt file
outputInWords: false, // get output result in wts file for karaoke
translateToEnglish: false, // translate from source language to english
wordTimestamps: false, // word-level timestamps
timestamps_length: 20, // amount of dialogue per timestamp pair
splitOnWord: true, // split on word rather than on token
noGpu: false, // disable GPU inference
},
})
// Model list
const MODELS_LIST = [
'tiny',
'tiny.en',
'base',
'base.en',
'small',
'small.en',
'medium',
'medium.en',
'large-v1',
'large',
'large-v3-turbo',
]
Custom CMake flags can be passed with NODEJS_WHISPER_CMAKE_ARGS.
NODEJS_WHISPER_CMAKE_ARGS="-DGGML_NATIVE=OFF" npm test
When modelRootPath is used with autoDownloadModelName, downloaded models are saved in that directory.
Docker model cache example:
volumes:
- ./.docker-data/whisper-models:/data/whisper-models
await nodewhisper(filePath, {
modelName: 'tiny.en',
autoDownloadModelName: 'tiny.en',
modelRootPath: '/data/whisper-models',
whisperOptions: {
outputInSrt: true,
},
})
The downloaded model will be stored at /data/whisper-models/ggml-tiny.en.bin, while the package's internal downloader scripts remain available.
interface IOptions {
modelName: string
modelRootPath?: string
removeWavFileAfterTranscription?: boolean
withCuda?: boolean
autoDownloadModelName?: string
whisperOptions?: WhisperOptions
logger?: Console
}
interface WhisperOptions {
outputInCsv?: boolean
outputInJson?: boolean
outputInJsonFull?: boolean
outputInLrc?: boolean
outputInSrt?: boolean
outputInText?: boolean
outputInVtt?: boolean
outputInWords?: boolean
translateToEnglish?: boolean
timestamps_length?: number
wordTimestamps?: boolean
splitOnWord?: boolean
noGpu?: boolean
}
Clone the project
git clone https://github.com/ChetanXpro/nodejs-whisper
Go to the project directory
cd nodejs-whisper
Install dependencies
npm install
Start the server
npm run dev
Build project
npm run build
If you have any feedback, please reach out to us at chetanbaliyan10@gmail.com
FAQs
Node bindings for OpenAI's Whisper. Optimized for CPU.
The npm package nodejs-whisper receives a total of 4,582 weekly downloads. As such, nodejs-whisper popularity was classified as popular.
We found that nodejs-whisper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.