{"id":20424869,"url":"https://github.com/chetanxpro/nodejs-whisper","last_synced_at":"2025-04-12T18:52:11.987Z","repository":{"id":184703155,"uuid":"672339162","full_name":"ChetanXpro/nodejs-whisper","owner":"ChetanXpro","description":"Introducing NodeJS Bindings for Whisper - the CPU version of OpenAI's Whisper, as initially crafted in C++ by ggerganov.","archived":false,"fork":false,"pushed_at":"2024-05-13T12:51:28.000Z","size":187,"stargazers_count":52,"open_issues_count":6,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-18T03:45:44.373Z","etag":null,"topics":["ai","cpp","ml","nodejs-whisper","openai","speech-recognition","speech-to-text","timestamp","whisper","whisper-nodejs"],"latest_commit_sha":null,"homepage":"https://npmjs.com/nodejs-whisper","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChetanXpro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-29T18:26:39.000Z","updated_at":"2024-06-04T08:26:19.086Z","dependencies_parsed_at":"2023-07-30T11:03:19.800Z","dependency_job_id":"ddab808a-df6f-4b97-9ee9-3976b7ff5cbc","html_url":"https://github.com/ChetanXpro/nodejs-whisper","commit_stats":null,"previous_names":["chetanxpro/node-whisper","chetanxpro/nodejs-whisper"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChetanXpro%2Fnodejs-whisper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChetanXpro%2Fnodejs-whisper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChetanXpro%2Fnodejs-whisper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChetanXpro%2Fnodejs-whisper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChetanXpro","download_url":"https://codeload.github.com/ChetanXpro/nodejs-whisper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618229,"owners_count":21134200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cpp","ml","nodejs-whisper","openai","speech-recognition","speech-to-text","timestamp","whisper","whisper-nodejs"],"created_at":"2024-11-15T07:11:17.617Z","updated_at":"2025-04-12T18:52:11.973Z","avatar_url":"https://github.com/ChetanXpro.png","language":"TypeScript","readme":"# nodejs-whisper\n\nNode.js bindings for OpenAI's Whisper model.\n\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)\n\n## Features\n\n-   Automatically convert the audio to WAV format with a 16000 Hz frequency to support the whisper model.\n-   Output transcripts to (.txt .srt .vtt .json .wts .lrc)\n-   Optimized for CPU (Including Apple Silicon ARM)\n-   Timestamp precision to single word\n-   Split on word rather than on token (Optional)\n-   Translate from source language to english (Optional)\n-   Convert audio format to wav to support whisper model\n\n## Installation\n\n1. Install make tools\n\n```bash\nsudo apt update\nsudo apt install build-essential\n```\n\n2. Install nodejs-whisper with npm\n\n```bash\n  npm i nodejs-whisper\n```\n\n3. Download whisper model\n\n```bash\n  npx nodejs-whisper download\n```\n\n-   NOTE: user may need to install make tool\n\n### Windows Installation\n\n1. Install MinGW-w64 or MSYS2 (which includes make tools)\n   - Option 1: Install MSYS2 from https://www.msys2.org/\n   - Option 2: Install MinGW-w64 from https://www.mingw-w64.org/\n\n2. Install nodejs-whisper with npm\n```bash\nnpm i nodejs-whisper\n```\n\n3. Download whisper model\n```bash\nnpx nodejs-whisper download\n```\n\n- Note: Make sure mingw32-make or make is available in your system PATH.\n\n## Usage/Examples\n\nSee `example/index.ts` (can be run with `$ npm run test`)\n\n```javascript\nimport path from 'path'\nimport { nodewhisper } from 'nodejs-whisper'\n\n// Need to provide exact path to your audio file.\nconst filePath = path.resolve(__dirname, 'YourAudioFileName')\n\nawait nodewhisper(filePath, {\n\tmodelName: 'base.en', //Downloaded models name\n\tautoDownloadModelName: 'base.en', // (optional) autodownload a model if model is not present\n\tremoveWavFileAfterTranscription: false, // (optional) remove wav file once transcribed\n\twithCuda: false // (optional) use cuda for faster processing\n\tlogger: console // (optional) Logging instance, defaults to console\n\twhisperOptions: {\n\t\toutputInCsv: false, // get output result in csv file\n\t\toutputInJson: false, // get output result in json file\n\t\toutputInJsonFull: false, // get output result in json file including more information\n\t\toutputInLrc: false, // get output result in lrc file\n\t\toutputInSrt: true, // get output result in srt file\n\t\toutputInText: false, // get output result in txt file\n\t\toutputInVtt: false, // get output result in vtt file\n\t\toutputInWords: false, // get output result in wts file for karaoke\n\t\ttranslateToEnglish: false, // translate from source language to english\n\t\twordTimestamps: false, // word-level timestamps\n\t\ttimestamps_length: 20, // amount of dialogue per timestamp pair\n\t\tsplitOnWord: true, // split on word rather than on token\n\t},\n})\n\n// Model list\nconst MODELS_LIST = [\n\t'tiny',\n\t'tiny.en',\n\t'base',\n\t'base.en',\n\t'small',\n\t'small.en',\n\t'medium',\n\t'medium.en',\n\t'large-v1',\n\t'large',\n\t'large-v3-turbo',\n]\n```\n\n## Types\n\n```\n interface IOptions {\n\tmodelName: string\n\tremoveWavFileAfterTranscription?: boolean\n\twithCuda?: boolean\n\tautoDownloadModelName?: string\n\twhisperOptions?: WhisperOptions\n\tlogger?: Console\n}\n\n interface WhisperOptions {\n\toutputInCsv?: boolean\n\toutputInJson?: boolean\n\toutputInJsonFull?: boolean\n\toutputInLrc?: boolean\n\toutputInSrt?: boolean\n\toutputInText?: boolean\n\toutputInVtt?: boolean\n\toutputInWords?: boolean\n\ttranslateToEnglish?: boolean\n\ttimestamps_length?: number\n\twordTimestamps?: boolean\n\tsplitOnWord?: boolean\n}\n\n```\n\n## Run locally\n\nClone the project\n\n```bash\n  git clone https://github.com/ChetanXpro/nodejs-whisper\n```\n\nGo to the project directory\n\n```bash\n  cd nodejs-whisper\n```\n\nInstall dependencies\n\n```bash\n  npm install\n```\n\nStart the server\n\n```bash\n  npm run dev\n```\n\nBuild project\n\n```bash\n  npm run build\n```\n\n## Made with\n\n-   [Whisper OpenAI (using C++ port by: ggerganov)](https://github.com/ggerganov/whisper.cpp)\n\n## Feedback\n\nIf you have any feedback, please reach out to us at chetanbaliyan10@gmail.com\n\n## Authors\n\n-   [@chetanXpro](https://www.github.com/chetanXpro)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchetanxpro%2Fnodejs-whisper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchetanxpro%2Fnodejs-whisper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchetanxpro%2Fnodejs-whisper/lists"}