{"id":13901290,"url":"https://github.com/ariym/whisper-node","last_synced_at":"2025-04-13T07:49:53.316Z","repository":{"id":144700665,"uuid":"579522507","full_name":"ariym/whisper-node","owner":"ariym","description":"Node.js bindings for OpenAI's Whisper. (C++ CPU version by ggerganov)","archived":false,"fork":false,"pushed_at":"2024-08-05T03:52:59.000Z","size":51,"stargazers_count":267,"open_issues_count":28,"forks_count":45,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T07:49:48.625Z","etag":null,"topics":["ai","cpp","ffmpeg","ml","nodejs","openai","typescript","whisper"],"latest_commit_sha":null,"homepage":"https://npmjs.com/whisper-node","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/ariym.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":"2022-12-18T00:48:06.000Z","updated_at":"2025-04-10T17:47:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a8e37a0-2658-4453-b655-b2c38f765ccf","html_url":"https://github.com/ariym/whisper-node","commit_stats":{"total_commits":56,"total_committers":6,"mean_commits":9.333333333333334,"dds":0.5714285714285714,"last_synced_commit":"c72944cfa48f5c74662ff17ee2dc1d5f7624393e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariym%2Fwhisper-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariym%2Fwhisper-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariym%2Fwhisper-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariym%2Fwhisper-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ariym","download_url":"https://codeload.github.com/ariym/whisper-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"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","ffmpeg","ml","nodejs","openai","typescript","whisper"],"created_at":"2024-08-06T21:01:08.668Z","updated_at":"2025-04-13T07:49:53.289Z","avatar_url":"https://github.com/ariym.png","language":"TypeScript","readme":"# whisper-node\n\n[![npm downloads](https://img.shields.io/npm/dm/whisper-node)](https://npmjs.org/package/whisper-node)\n[![npm downloads](https://img.shields.io/npm/l/whisper-node)](https://npmjs.org/package/whisper-node)  \n\nNode.js bindings for OpenAI's Whisper. Transcription done local.\n\n## Features\n\n- Output transcripts to **JSON** (also .txt .srt .vtt)\n- **Optimized for CPU** (Including Apple Silicon ARM)\n- Timestamp precision to single word\n\n## Installation\n\n1. Add dependency to project\n\n```text\nnpm install whisper-node\n```\n\n2. Download whisper model of choice [OPTIONAL]\n\n```text\nnpx whisper-node download\n```\n\n[Requirement for Windows: Install the ```make``` command from here.](https://gnuwin32.sourceforge.net/packages/make.htm)\n\n## Usage\n\n```javascript\nimport whisper from 'whisper-node';\n\nconst transcript = await whisper(\"example/sample.wav\");\n\nconsole.log(transcript); // output: [ {start,end,speech} ]\n```\n\n### Output (JSON)\n\n```javascript\n[\n  {\n    \"start\":  \"00:00:14.310\", // time stamp begin\n    \"end\":    \"00:00:16.480\", // time stamp end\n    \"speech\": \"howdy\"         // transcription\n  }\n]\n```\n\n### Full Options List\n\n```javascript\nimport whisper from 'whisper-node';\n\nconst filePath = \"example/sample.wav\"; // required\n\nconst options = {\n  modelName: \"base.en\",       // default\n  // modelPath: \"/custom/path/to/model.bin\", // use model in a custom directory (cannot use along with 'modelName')\n  whisperOptions: {\n    language: 'auto'          // default (use 'auto' for auto detect)\n    gen_file_txt: false,      // outputs .txt file\n    gen_file_subtitle: false, // outputs .srt file\n    gen_file_vtt: false,      // outputs .vtt file\n    word_timestamps: true     // timestamp for every word\n    // timestamp_size: 0      // cannot use along with word_timestamps:true\n  }\n}\n\nconst transcript = await whisper(filePath, options);\n```\n\n### Input File Format\n\nFiles must be .wav and 16Hz\n\nExample .mp3 file converted with an [FFmpeg](https://ffmpeg.org) command: ```ffmpeg -i input.mp3 -ar 16000 output.wav```\n\n## Made with\n\n- [Whisper OpenAI (using C++ port by: ggerganov)](https://github.com/ggerganov/whisper.cpp)\n- [ShellJS](https://www.npmjs.com/package/shelljs)\n\n## Roadmap\n\n- [x] Support projects not using Typescript\n- [x] Allow custom directory for storing models\n- [ ] Config files as alternative to model download cli\n- [ ] Remove *path*, *shelljs* and *prompt-sync* package for browser, react-native expo, and webassembly compatibility\n- [ ] [fluent-ffmpeg](https://www.npmjs.com/package/fluent-ffmpeg) to automatically convert to 16Hz .wav files as well as support separating audio from video\n- [ ] [Pyanote diarization](https://huggingface.co/pyannote/speaker-diarization) for speaker names\n- [ ] [Implement WhisperX as optional alternative model](https://github.com/m-bain/whisperX) for diarization and higher precision timestamps (as alternative to C++ version)\n- [ ] Add option for viewing detected langauge as described in [Issue 16](https://github.com/ariym/whisper-node/issues/16)\n- [ ] Include typescript typescript types in ```d.ts``` file\n- [x] Add support for language option\n- [ ] Add support for transcribing audio streams as already implemented in whisper.cpp\n\n## Modifying whisper-node\n\n```npm run dev``` - runs nodemon and tsc on '/src/test.ts'\n\n```npm run build``` - runs tsc, outputs to '/dist' and gives sh permission to 'dist/download.js'\n\n## Acknowledgements\n\n- [Georgi Gerganov](https://ggerganov.com/)\n- [Ari](https://aricv.com)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariym%2Fwhisper-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fariym%2Fwhisper-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariym%2Fwhisper-node/lists"}