[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-733":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},733,"whisper.cpp","ggml-org\u002Fwhisper.cpp","ggml-org","Port of OpenAI's Whisper model in C\u002FC++","",null,"C++",50645,5652,372,1043,0,25,201,1058,131,45,"MIT License",false,"master",true,[27,28,29,30,31,32],"inference","openai","speech-recognition","speech-to-text","transformer","whisper","2026-06-12 02:00:17","# whisper.cpp\n\n![whisper.cpp](https:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F235238348-05d0f6a4-da44-4900-a1de-d0707e75b763.jpeg)\n\n[![Actions Status](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fworkflows\u002FCI\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Factions)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![Conan Center](https:\u002F\u002Fshields.io\u002Fconan\u002Fv\u002Fwhisper-cpp)](https:\u002F\u002Fconan.io\u002Fcenter\u002Fwhisper-cpp)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fwhisper.cpp.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fwhisper.cpp\u002F)\n\nStable: [v1.8.1](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Freleases\u002Ftag\u002Fv1.8.1) \u002F [Roadmap](https:\u002F\u002Fgithub.com\u002Forgs\u002Fggml-org\u002Fprojects\u002F4\u002F)\n\nHigh-performance inference of [OpenAI's Whisper](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fwhisper) automatic speech recognition (ASR) model:\n\n- Plain C\u002FC++ implementation without dependencies\n- Apple Silicon first-class citizen - optimized via ARM NEON, Accelerate framework, Metal and [Core ML](#core-ml-support)\n- AVX intrinsics support for x86 architectures\n- [VSX intrinsics support for POWER architectures](#power-vsx-intrinsics)\n- Mixed F16 \u002F F32 precision\n- [Integer quantization support](#quantization)\n- Zero memory allocations at runtime\n- [Vulkan support](#vulkan-gpu-support)\n- Support for CPU-only inference\n- [Efficient GPU support for NVIDIA](#nvidia-gpu-support)\n- [OpenVINO Support](#openvino-support)\n- [Ascend NPU Support](#ascend-npu-support)\n- [Moore Threads GPU Support](#moore-threads-gpu-support)\n- [C-style API](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fblob\u002Fmaster\u002Finclude\u002Fwhisper.h)\n- [Voice Activity Detection (VAD)](#voice-activity-detection-vad)\n\nSupported platforms:\n\n- [x] Mac OS (Intel and Arm)\n- [x] [iOS](examples\u002Fwhisper.objc)\n- [x] [Android](examples\u002Fwhisper.android)\n- [x] [Java](bindings\u002Fjava\u002FREADME.md)\n- [x] Linux \u002F [FreeBSD](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fissues\u002F56#issuecomment-1350920264)\n- [x] [WebAssembly](examples\u002Fwhisper.wasm)\n- [x] Windows ([MSVC](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fblob\u002Fmaster\u002F.github\u002Fworkflows\u002Fbuild.yml#L117-L144) and [MinGW](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fissues\u002F168))\n- [x] [Raspberry Pi](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002F166)\n- [x] [Docker](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fpkgs\u002Fcontainer\u002Fwhisper.cpp)\n\nThe entire high-level implementation of the model is contained in [whisper.h](include\u002Fwhisper.h) and [whisper.cpp](src\u002Fwhisper.cpp).\nThe rest of the code is part of the [`ggml`](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fggml) machine learning library.\n\nHaving such a lightweight implementation of the model allows to easily integrate it in different platforms and applications.\nAs an example, here is a video of running the model on an iPhone 13 device - fully offline, on-device: [whisper.objc](examples\u002Fwhisper.objc)\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F197385372-962a6dea-bca1-4d50-bf96-1d8c27b98c81.mp4\n\nYou can also easily make your own offline voice assistant application: [command](examples\u002Fcommand)\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F204038393-2f846eae-c255-4099-a76d-5735c25c49da.mp4\n\nOn Apple Silicon, the inference runs fully on the GPU via Metal:\n\nhttps:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fassets\u002F1991296\u002Fc82e8f86-60dc-49f2-b048-d2fdbd6b5225\n\n## Quick start\n\nFirst clone the repository:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp.git\n```\n\nNavigate into the directory:\n\n```\ncd whisper.cpp\n```\n\nThen, download one of the Whisper [models](models\u002FREADME.md) converted in [`ggml` format](#ggml-format). For example:\n\n```bash\nsh .\u002Fmodels\u002Fdownload-ggml-model.sh base.en\n```\n\nNow build the [whisper-cli](examples\u002Fcli) example and transcribe an audio file like this:\n\n```bash\n# build the project\ncmake -B build\ncmake --build build -j --config Release\n\n# transcribe an audio file\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli -f samples\u002Fjfk.wav\n```\n\n---\n\nFor a quick demo, simply run `make base.en`.\n\nThe command downloads the `base.en` model converted to custom `ggml` format and runs the inference on all `.wav` samples in the folder `samples`.\n\nFor detailed usage instructions, run: `.\u002Fbuild\u002Fbin\u002Fwhisper-cli -h`\n\nNote that the [whisper-cli](examples\u002Fcli) example currently runs only with 16-bit WAV files, so make sure to convert your input before running the tool.\nFor example, you can use `ffmpeg` like this:\n\n```bash\nffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav\n```\n\n## More audio samples\n\nIf you want some extra audio samples to play with, simply run:\n\n```\nmake -j samples\n```\n\nThis will download a few more audio files from Wikipedia and convert them to 16-bit WAV format via `ffmpeg`.\n\nYou can download and run the other models as follows:\n\n```\nmake -j tiny.en\nmake -j tiny\nmake -j base.en\nmake -j base\nmake -j small.en\nmake -j small\nmake -j medium.en\nmake -j medium\nmake -j large-v1\nmake -j large-v2\nmake -j large-v3\nmake -j large-v3-turbo\n```\n\n## Memory usage\n\n| Model  | Disk    | Mem     |\n| ------ | ------- | ------- |\n| tiny   | 75 MiB  | ~273 MB |\n| base   | 142 MiB | ~388 MB |\n| small  | 466 MiB | ~852 MB |\n| medium | 1.5 GiB | ~2.1 GB |\n| large  | 2.9 GiB | ~3.9 GB |\n\n## POWER VSX Intrinsics\n\n`whisper.cpp` supports POWER architectures and includes code which\nsignificantly speeds operation on Linux running on POWER9\u002F10, making it\ncapable of faster-than-realtime transcription on underclocked Raptor\nTalos II. Ensure you have a BLAS package installed, and replace the\nstandard cmake setup with:\n\n```bash\n# build with GGML_BLAS defined\ncmake -B build -DGGML_BLAS=1\ncmake --build build -j --config Release\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli [ .. etc .. ]\n```\n\n## Quantization\n\n`whisper.cpp` supports integer quantization of the Whisper `ggml` models.\nQuantized models require less memory and disk space and depending on the hardware can be processed more efficiently.\n\nHere are the steps for creating and using a quantized model:\n\n```bash\n# quantize a model with Q5_0 method\ncmake -B build\ncmake --build build -j --config Release\n.\u002Fbuild\u002Fbin\u002Fquantize models\u002Fggml-base.en.bin models\u002Fggml-base.en-q5_0.bin q5_0\n\n# run the examples as usual, specifying the quantized model file\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli -m models\u002Fggml-base.en-q5_0.bin .\u002Fsamples\u002Fgb0.wav\n```\n\n## Core ML support\n\nOn Apple Silicon devices, the Encoder inference can be executed on the Apple Neural Engine (ANE) via Core ML. This can result in significant\nspeed-up - more than x3 faster compared with CPU-only execution. Here are the instructions for generating a Core ML model and using it with `whisper.cpp`:\n\n- Install Python dependencies needed for the creation of the Core ML model:\n\n  ```bash\n  pip install ane_transformers\n  pip install openai-whisper\n  pip install coremltools\n  ```\n\n  - To ensure `coremltools` operates correctly, please confirm that [Xcode](https:\u002F\u002Fdeveloper.apple.com\u002Fxcode\u002F) is installed and execute `xcode-select --install` to install the command-line tools.\n  - Python 3.11 is recommended.\n  - MacOS Sonoma (version 14) or newer is recommended, as older versions of MacOS might experience issues with transcription hallucination.\n  - [OPTIONAL] It is recommended to utilize a Python version management system, such as [Miniconda](https:\u002F\u002Fdocs.conda.io\u002Fen\u002Flatest\u002Fminiconda.html) for this step:\n    - To create an environment, use: `conda create -n py311-whisper python=3.11 -y`\n    - To activate the environment, use: `conda activate py311-whisper`\n\n- Generate a Core ML model. For example, to generate a `base.en` model, use:\n\n  ```bash\n  .\u002Fmodels\u002Fgenerate-coreml-model.sh base.en\n  ```\n\n  This will generate the folder `models\u002Fggml-base.en-encoder.mlmodelc`\n\n- Build `whisper.cpp` with Core ML support:\n\n  ```bash\n  # using CMake\n  cmake -B build -DWHISPER_COREML=1\n  cmake --build build -j --config Release\n  ```\n\n- Run the examples as usual. For example:\n\n  ```text\n  $ .\u002Fbuild\u002Fbin\u002Fwhisper-cli -m models\u002Fggml-base.en.bin -f samples\u002Fjfk.wav\n\n  ...\n\n  whisper_init_state: loading Core ML model from 'models\u002Fggml-base.en-encoder.mlmodelc'\n  whisper_init_state: first run on a device may take a while ...\n  whisper_init_state: Core ML model loaded\n\n  system_info: n_threads = 4 \u002F 10 | AVX = 0 | AVX2 = 0 | AVX512 = 0 | FMA = 0 | NEON = 1 | ARM_FMA = 1 | F16C = 0 | FP16_VA = 1 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 0 | VSX = 0 | COREML = 1 |\n\n  ...\n  ```\n\n  The first run on a device is slow, since the ANE service compiles the Core ML model to some device-specific format.\n  Next runs are faster.\n\nFor more information about the Core ML implementation please refer to PR [#566](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fpull\u002F566).\n\n## OpenVINO support\n\nOn platforms that support [OpenVINO](https:\u002F\u002Fgithub.com\u002Fopenvinotoolkit\u002Fopenvino), the Encoder inference can be executed\non OpenVINO-supported devices including x86 CPUs and Intel GPUs (integrated & discrete).\n\nThis can result in significant speedup in encoder performance. Here are the instructions for generating the OpenVINO model and using it with `whisper.cpp`:\n\n- First, setup python virtual env. and install python dependencies. Python 3.10 is recommended.\n\n  Windows:\n\n  ```powershell\n  cd models\n  python -m venv openvino_conv_env\n  openvino_conv_env\\Scripts\\activate\n  python -m pip install --upgrade pip\n  pip install -r requirements-openvino.txt\n  ```\n\n  Linux and macOS:\n\n  ```bash\n  cd models\n  python3 -m venv openvino_conv_env\n  source openvino_conv_env\u002Fbin\u002Factivate\n  python -m pip install --upgrade pip\n  pip install -r requirements-openvino.txt\n  ```\n\n- Generate an OpenVINO encoder model. For example, to generate a `base.en` model, use:\n\n  ```\n  python convert-whisper-to-openvino.py --model base.en\n  ```\n\n  This will produce ggml-base.en-encoder-openvino.xml\u002F.bin IR model files. It's recommended to relocate these to the same folder as `ggml` models, as that\n  is the default location that the OpenVINO extension will search at runtime.\n\n- Build `whisper.cpp` with OpenVINO support:\n\n  Download OpenVINO package from [release page](https:\u002F\u002Fgithub.com\u002Fopenvinotoolkit\u002Fopenvino\u002Freleases). The recommended version to use is [2024.6.0](https:\u002F\u002Fgithub.com\u002Fopenvinotoolkit\u002Fopenvino\u002Freleases\u002Ftag\u002F2024.6.0). Ready to use Binaries of the required libraries can be found in the [OpenVino Archives](https:\u002F\u002Fstorage.openvinotoolkit.org\u002Frepositories\u002Fopenvino\u002Fpackages\u002F2024.6\u002F)\n\n  After downloading & extracting package onto your development system, set up required environment by sourcing setupvars script. For example:\n\n  Linux:\n\n  ```bash\n  source \u002Fpath\u002Fto\u002Fl_openvino_toolkit_ubuntu22_2023.0.0.10926.b4452d56304_x86_64\u002Fsetupvars.sh\n  ```\n\n  Windows (cmd):\n\n  ```powershell\n  C:\\Path\\To\\w_openvino_toolkit_windows_2023.0.0.10926.b4452d56304_x86_64\\setupvars.bat\n  ```\n\n  And then build the project using cmake:\n\n  ```bash\n  cmake -B build -DWHISPER_OPENVINO=1\n  cmake --build build -j --config Release\n  ```\n\n- Run the examples as usual. For example:\n\n  ```text\n  $ .\u002Fbuild\u002Fbin\u002Fwhisper-cli -m models\u002Fggml-base.en.bin -f samples\u002Fjfk.wav\n\n  ...\n\n  whisper_ctx_init_openvino_encoder: loading OpenVINO model from 'models\u002Fggml-base.en-encoder-openvino.xml'\n  whisper_ctx_init_openvino_encoder: first run on a device may take a while ...\n  whisper_openvino_init: path_model = models\u002Fggml-base.en-encoder-openvino.xml, device = GPU, cache_dir = models\u002Fggml-base.en-encoder-openvino-cache\n  whisper_ctx_init_openvino_encoder: OpenVINO model loaded\n\n  system_info: n_threads = 4 \u002F 8 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | VSX = 0 | COREML = 0 | OPENVINO = 1 |\n\n  ...\n  ```\n\n  The first time run on an OpenVINO device is slow, since the OpenVINO framework will compile the IR (Intermediate Representation) model to a device-specific 'blob'. This device-specific blob will get\n  cached for the next run.\n\nFor more information about the OpenVINO implementation please refer to PR [#1037](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fpull\u002F1037).\n\n## NVIDIA GPU support\n\nWith NVIDIA cards the processing of the models is done efficiently on the GPU via cuBLAS and custom CUDA kernels.\nFirst, make sure you have installed `cuda`: https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads\n\nNow build `whisper.cpp` with CUDA support:\n\n```\ncmake -B build -DGGML_CUDA=1\ncmake --build build -j --config Release\n```\n\nor for newer NVIDIA GPU's (RTX 5000 series):\n```\ncmake -B build -DGGML_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES=\"86\"\ncmake --build build -j --config Release\n```\n\n## Vulkan GPU support\nCross-vendor solution which allows you to accelerate workload on your GPU.\nFirst, make sure your graphics card driver provides support for Vulkan API.\n\nNow build `whisper.cpp` with Vulkan support:\n```\ncmake -B build -DGGML_VULKAN=1\ncmake --build build -j --config Release\n```\n\n## BLAS CPU support via OpenBLAS\n\nEncoder processing can be accelerated on the CPU via OpenBLAS.\nFirst, make sure you have installed `openblas`: https:\u002F\u002Fwww.openblas.net\u002F\n\nNow build `whisper.cpp` with OpenBLAS support:\n\n```\ncmake -B build -DGGML_BLAS=1\ncmake --build build -j --config Release\n```\n\n## Ascend NPU support\n\nAscend NPU provides inference acceleration via [`CANN`](https:\u002F\u002Fwww.hiascend.com\u002Fen\u002Fsoftware\u002Fcann) and AI cores.\n\nFirst, check if your Ascend NPU device is supported:\n\n**Verified devices**\n| Ascend NPU                    | Status  |\n|:-----------------------------:|:-------:|\n| Atlas 300T A2                 | Support |\n| Atlas 300I Duo                | Support |\n\nThen, make sure you have installed [`CANN toolkit`](https:\u002F\u002Fwww.hiascend.com\u002Fen\u002Fsoftware\u002Fcann\u002Fcommunity) . The lasted version of CANN is recommanded.\n\nNow build `whisper.cpp` with CANN support:\n\n```\ncmake -B build -DGGML_CANN=1\ncmake --build build -j --config Release\n```\n\nRun the inference examples as usual, for example:\n\n```\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli -f samples\u002Fjfk.wav -m models\u002Fggml-base.en.bin -t 8\n```\n\n*Notes:*\n\n- If you have trouble with Ascend NPU device, please create a issue with **[CANN]** prefix\u002Ftag.\n- If you run successfully with your Ascend NPU device, please help update the table `Verified devices`.\n\n## Moore Threads GPU support\n\nWith Moore Threads cards the processing of the models is done efficiently on the GPU via muBLAS and custom MUSA kernels.\nFirst, make sure you have installed `MUSA SDK rc4.2.0`: https:\u002F\u002Fdeveloper.mthreads.com\u002Fsdk\u002Fdownload\u002Fmusa?equipment=&os=&driverVersion=&version=4.2.0\n\nNow build `whisper.cpp` with MUSA support:\n\n```\ncmake -B build -DGGML_MUSA=1\ncmake --build build -j --config Release\n```\n\nor specify the architecture for your Moore Threads GPU. For example, if you have a MTT S80 GPU, you can specify the architecture as follows:\n\n```\ncmake -B build -DGGML_MUSA=1 -DMUSA_ARCHITECTURES=\"21\"\ncmake --build build -j --config Release\n```\n\n## FFmpeg support (Linux only)\n\nIf you want to support more audio formats (such as Opus and AAC), you can turn on the `WHISPER_FFMPEG` build flag to enable FFmpeg integration.\n\nFirst, you need to install required libraries:\n\n```bash\n# Debian\u002FUbuntu\nsudo apt install libavcodec-dev libavformat-dev libavutil-dev\n\n# RHEL\u002FFedora\nsudo dnf install libavcodec-free-devel libavformat-free-devel libavutil-free-devel\n```\n\nThen you can build the project as follows:\n\n```bash\ncmake -B build -D WHISPER_FFMPEG=yes\ncmake --build build\n```\n\nRun the following example to confirm it's working:\n\n```bash\n# Convert an audio file to Opus format\nffmpeg -i samples\u002Fjfk.wav jfk.opus\n\n# Transcribe the audio file\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli --model models\u002Fggml-base.en.bin --file jfk.opus\n```\n\n## Docker\n\n### Prerequisites\n\n- Docker must be installed and running on your system.\n- Create a folder to store big models & intermediate files (ex. \u002Fwhisper\u002Fmodels)\n\n### Images\n\nWe have multiple Docker images available for this project:\n\n1. `ghcr.io\u002Fggml-org\u002Fwhisper.cpp:main`: This image includes the main executable file as well as `curl` and `ffmpeg`. (platforms: `linux\u002Famd64`, `linux\u002Farm64`)\n2. `ghcr.io\u002Fggml-org\u002Fwhisper.cpp:main-cuda`: Same as `main` but compiled with CUDA support. (platforms: `linux\u002Famd64`)\n3. `ghcr.io\u002Fggml-org\u002Fwhisper.cpp:main-musa`: Same as `main` but compiled with MUSA support. (platforms: `linux\u002Famd64`)\n4. `ghcr.io\u002Fggml-org\u002Fwhisper.cpp:main-vulkan`: Same as `main` but compiled with Vulkan support. (platforms: `linux\u002Famd64`)\n\n### Usage\n\n```shell\n# download model and persist it in a local folder\ndocker run -it --rm \\\n  -v path\u002Fto\u002Fmodels:\u002Fmodels \\\n  whisper.cpp:main \".\u002Fmodels\u002Fdownload-ggml-model.sh base \u002Fmodels\"\n\n# transcribe an audio file\ndocker run -it --rm \\\n  -v path\u002Fto\u002Fmodels:\u002Fmodels \\\n  -v path\u002Fto\u002Faudios:\u002Faudios \\\n  whisper.cpp:main \"whisper-cli -m \u002Fmodels\u002Fggml-base.bin -f \u002Faudios\u002Fjfk.wav\"\n\n# transcribe an audio file in samples folder\ndocker run -it --rm \\\n  -v path\u002Fto\u002Fmodels:\u002Fmodels \\\n  whisper.cpp:main \"whisper-cli -m \u002Fmodels\u002Fggml-base.bin -f .\u002Fsamples\u002Fjfk.wav\"\n\n# run the web server\ndocker run -it --rm -p \"8080:8080\" \\\n  -v path\u002Fto\u002Fmodels:\u002Fmodels \\\n  whisper.cpp:main \"whisper-server --host 127.0.0.1 -m \u002Fmodels\u002Fggml-base.bin\"\n  \n# run the bench too on the small.en model using 4 threads\ndocker run -it --rm \\\n  -v path\u002Fto\u002Fmodels:\u002Fmodels \\\n  whisper.cpp:main \"whisper-bench -m \u002Fmodels\u002Fggml-small.en.bin -t 4\"\n```\n\n## Installing with Conan\n\nYou can install pre-built binaries for whisper.cpp or build it from source using [Conan](https:\u002F\u002Fconan.io\u002F). Use the following command:\n\n```\nconan install --requires=\"whisper-cpp\u002F[*]\" --build=missing\n```\n\nFor detailed instructions on how to use Conan, please refer to the [Conan documentation](https:\u002F\u002Fdocs.conan.io\u002F2\u002F).\n\n## Limitations\n\n- Inference only\n\n## Real-time audio input example\n\nThis is a naive example of performing real-time inference on audio from your microphone.\nThe [stream](examples\u002Fstream) tool samples the audio every half a second and runs the transcription continuously.\nMore info is available in [issue #10](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fissues\u002F10).\nYou will need to have [sdl2](https:\u002F\u002Fwiki.libsdl.org\u002FSDL2\u002FInstallation) installed for it to work properly.\n\n```bash\ncmake -B build -DWHISPER_SDL2=ON\ncmake --build build -j --config Release\n.\u002Fbuild\u002Fbin\u002Fwhisper-stream -m .\u002Fmodels\u002Fggml-base.en.bin -t 8 --step 500 --length 5000\n```\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F194935793-76afede7-cfa8-48d8-a80f-28ba83be7d09.mp4\n\n## Confidence color-coding\n\nAdding the `--print-colors` argument will print the transcribed text using an experimental color coding strategy\nto highlight words with high or low confidence:\n\n```bash\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli -m models\u002Fggml-base.en.bin -f samples\u002Fgb0.wav --print-colors\n```\n\n\u003Cimg width=\"965\" alt=\"image\" src=\"https:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F197356445-311c8643-9397-4e5e-b46e-0b4b4daa2530.png\">\n\n## Controlling the length of the generated text segments (experimental)\n\nFor example, to limit the line length to a maximum of 16 characters, simply add `-ml 16`:\n\n```text\n$ .\u002Fbuild\u002Fbin\u002Fwhisper-cli -m .\u002Fmodels\u002Fggml-base.en.bin -f .\u002Fsamples\u002Fjfk.wav -ml 16\n\nwhisper_model_load: loading model from '.\u002Fmodels\u002Fggml-base.en.bin'\n...\nsystem_info: n_threads = 4 \u002F 10 | AVX2 = 0 | AVX512 = 0 | NEON = 1 | FP16_VA = 1 | WASM_SIMD = 0 | BLAS = 1 |\n\nmain: processing '.\u002Fsamples\u002Fjfk.wav' (176000 samples, 11.0 sec), 4 threads, 1 processors, lang = en, task = transcribe, timestamps = 1 ...\n\n[00:00:00.000 --> 00:00:00.850]   And so my\n[00:00:00.850 --> 00:00:01.590]   fellow\n[00:00:01.590 --> 00:00:04.140]   Americans, ask\n[00:00:04.140 --> 00:00:05.660]   not what your\n[00:00:05.660 --> 00:00:06.840]   country can do\n[00:00:06.840 --> 00:00:08.430]   for you, ask\n[00:00:08.430 --> 00:00:09.440]   what you can do\n[00:00:09.440 --> 00:00:10.020]   for your\n[00:00:10.020 --> 00:00:11.000]   country.\n```\n\n## Word-level timestamp (experimental)\n\nThe `--max-len` argument can be used to obtain word-level timestamps. Simply use `-ml 1`:\n\n```text\n$ .\u002Fbuild\u002Fbin\u002Fwhisper-cli -m .\u002Fmodels\u002Fggml-base.en.bin -f .\u002Fsamples\u002Fjfk.wav -ml 1\n\nwhisper_model_load: loading model from '.\u002Fmodels\u002Fggml-base.en.bin'\n...\nsystem_info: n_threads = 4 \u002F 10 | AVX2 = 0 | AVX512 = 0 | NEON = 1 | FP16_VA = 1 | WASM_SIMD = 0 | BLAS = 1 |\n\nmain: processing '.\u002Fsamples\u002Fjfk.wav' (176000 samples, 11.0 sec), 4 threads, 1 processors, lang = en, task = transcribe, timestamps = 1 ...\n\n[00:00:00.000 --> 00:00:00.320]\n[00:00:00.320 --> 00:00:00.370]   And\n[00:00:00.370 --> 00:00:00.690]   so\n[00:00:00.690 --> 00:00:00.850]   my\n[00:00:00.850 --> 00:00:01.590]   fellow\n[00:00:01.590 --> 00:00:02.850]   Americans\n[00:00:02.850 --> 00:00:03.300]  ,\n[00:00:03.300 --> 00:00:04.140]   ask\n[00:00:04.140 --> 00:00:04.990]   not\n[00:00:04.990 --> 00:00:05.410]   what\n[00:00:05.410 --> 00:00:05.660]   your\n[00:00:05.660 --> 00:00:06.260]   country\n[00:00:06.260 --> 00:00:06.600]   can\n[00:00:06.600 --> 00:00:06.840]   do\n[00:00:06.840 --> 00:00:07.010]   for\n[00:00:07.010 --> 00:00:08.170]   you\n[00:00:08.170 --> 00:00:08.190]  ,\n[00:00:08.190 --> 00:00:08.430]   ask\n[00:00:08.430 --> 00:00:08.910]   what\n[00:00:08.910 --> 00:00:09.040]   you\n[00:00:09.040 --> 00:00:09.320]   can\n[00:00:09.320 --> 00:00:09.440]   do\n[00:00:09.440 --> 00:00:09.760]   for\n[00:00:09.760 --> 00:00:10.020]   your\n[00:00:10.020 --> 00:00:10.510]   country\n[00:00:10.510 --> 00:00:11.000]  .\n```\n\n## Speaker segmentation via tinydiarize (experimental)\n\nMore information about this approach is available here: https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fpull\u002F1058\n\nSample usage:\n\n```py\n# download a tinydiarize compatible model\n.\u002Fmodels\u002Fdownload-ggml-model.sh small.en-tdrz\n\n# run as usual, adding the \"-tdrz\" command-line argument\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli -f .\u002Fsamples\u002Fa13.wav -m .\u002Fmodels\u002Fggml-small.en-tdrz.bin -tdrz\n...\nmain: processing '.\u002Fsamples\u002Fa13.wav' (480000 samples, 30.0 sec), 4 threads, 1 processors, lang = en, task = transcribe, tdrz = 1, timestamps = 1 ...\n...\n[00:00:00.000 --> 00:00:03.800]   Okay Houston, we've had a problem here. [SPEAKER_TURN]\n[00:00:03.800 --> 00:00:06.200]   This is Houston. Say again please. [SPEAKER_TURN]\n[00:00:06.200 --> 00:00:08.260]   Uh Houston we've had a problem.\n[00:00:08.260 --> 00:00:11.320]   We've had a main beam up on a volt. [SPEAKER_TURN]\n[00:00:11.320 --> 00:00:13.820]   Roger main beam interval. [SPEAKER_TURN]\n[00:00:13.820 --> 00:00:15.100]   Uh uh [SPEAKER_TURN]\n[00:00:15.100 --> 00:00:18.020]   So okay stand, by thirteen we're looking at it. [SPEAKER_TURN]\n[00:00:18.020 --> 00:00:25.740]   Okay uh right now uh Houston the uh voltage is uh is looking good um.\n[00:00:27.620 --> 00:00:29.940]   And we had a a pretty large bank or so.\n```\n\n## Karaoke-style movie generation (experimental)\n\nThe [whisper-cli](examples\u002Fcli) example provides support for output of karaoke-style movies, where the\ncurrently pronounced word is highlighted. Use the `-owts` argument and run the generated bash script.\nThis requires to have `ffmpeg` installed.\n\nHere are a few _\"typical\"_ examples:\n\n```bash\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli -m .\u002Fmodels\u002Fggml-base.en.bin -f .\u002Fsamples\u002Fjfk.wav -owts\nsource .\u002Fsamples\u002Fjfk.wav.wts\nffplay .\u002Fsamples\u002Fjfk.wav.mp4\n```\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F199337465-dbee4b5e-9aeb-48a3-b1c6-323ac4db5b2c.mp4\n\n---\n\n```bash\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli -m .\u002Fmodels\u002Fggml-base.en.bin -f .\u002Fsamples\u002Fmm0.wav -owts\nsource .\u002Fsamples\u002Fmm0.wav.wts\nffplay .\u002Fsamples\u002Fmm0.wav.mp4\n```\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F199337504-cc8fd233-0cb7-4920-95f9-4227de3570aa.mp4\n\n---\n\n```bash\n.\u002Fbuild\u002Fbin\u002Fwhisper-cli -m .\u002Fmodels\u002Fggml-base.en.bin -f .\u002Fsamples\u002Fgb0.wav -owts\nsource .\u002Fsamples\u002Fgb0.wav.wts\nffplay .\u002Fsamples\u002Fgb0.wav.mp4\n```\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F199337538-b7b0c7a3-2753-4a88-a0cd-f28a317987ba.mp4\n\n---\n\n## Video comparison of different models\n\nUse the [scripts\u002Fbench-wts.sh](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fblob\u002Fmaster\u002Fscripts\u002Fbench-wts.sh) script to generate a video in the following format:\n\n```bash\n.\u002Fscripts\u002Fbench-wts.sh samples\u002Fjfk.wav\nffplay .\u002Fsamples\u002Fjfk.wav.all.mp4\n```\n\nhttps:\u002F\u002Fuser-images.githubusercontent.com\u002F1991296\u002F223206245-2d36d903-cf8e-4f09-8c3b-eb9f9c39d6fc.mp4\n\n---\n\n## Benchmarks\n\nIn order to have an objective comparison of the performance of the inference across different system configurations,\nuse the [whisper-bench](examples\u002Fbench) tool. The tool simply runs the Encoder part of the model and prints how much time it\ntook to execute it. The results are summarized in the following Github issue:\n\n[Benchmark results](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fissues\u002F89)\n\nAdditionally a script to run whisper.cpp with different models and audio files is provided [bench.py](scripts\u002Fbench.py).\n\nYou can run it with the following command, by default it will run against any standard model in the models folder.\n\n```bash\npython3 scripts\u002Fbench.py -f samples\u002Fjfk.wav -t 2,4,8 -p 1,2\n```\n\nIt is written in python with the intention of being easy to modify and extend for your benchmarking use case.\n\nIt outputs a csv file with the results of the benchmarking.\n\n## `ggml` format\n\nThe original models are converted to a custom binary format. This allows to pack everything needed into a single file:\n\n- model parameters\n- mel filters\n- vocabulary\n- weights\n\nYou can download the converted models using the [models\u002Fdownload-ggml-model.sh](models\u002Fdownload-ggml-model.sh) script\nor manually from here:\n\n- https:\u002F\u002Fhuggingface.co\u002Fggerganov\u002Fwhisper.cpp\n\nFor more details, see the conversion script [models\u002Fconvert-pt-to-ggml.py](models\u002Fconvert-pt-to-ggml.py) or [models\u002FREADME.md](models\u002FREADME.md).\n\n## [Bindings](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002Fcategories\u002Fbindings)\n\n- [x] Rust: [tazz4843\u002Fwhisper-rs](https:\u002F\u002Fgithub.com\u002Ftazz4843\u002Fwhisper-rs) | [#310](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002F310)\n- [x] JavaScript: [bindings\u002Fjavascript](bindings\u002Fjavascript) | [#309](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002F309)\n  - React Native (iOS \u002F Android): [whisper.rn](https:\u002F\u002Fgithub.com\u002Fmybigday\u002Fwhisper.rn)\n- [x] Go: [bindings\u002Fgo](bindings\u002Fgo) | [#312](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002F312)\n- [x] Java:\n  - [GiviMAD\u002Fwhisper-jni](https:\u002F\u002Fgithub.com\u002FGiviMAD\u002Fwhisper-jni)\n- [x] Ruby: [bindings\u002Fruby](bindings\u002Fruby) | [#507](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002F507)\n- [x] Objective-C \u002F Swift: [ggml-org\u002Fwhisper.spm](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.spm) | [#313](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002F313)\n  - [exPHAT\u002FSwiftWhisper](https:\u002F\u002Fgithub.com\u002FexPHAT\u002FSwiftWhisper)\n- [x] .NET: | [#422](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002F422)\n  - [sandrohanea\u002Fwhisper.net](https:\u002F\u002Fgithub.com\u002Fsandrohanea\u002Fwhisper.net)\n  - [NickDarvey\u002Fwhisper](https:\u002F\u002Fgithub.com\u002FNickDarvey\u002Fwhisper)\n- [x] Python: | [#9](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fissues\u002F9)\n  - [stlukey\u002Fwhispercpp.py](https:\u002F\u002Fgithub.com\u002Fstlukey\u002Fwhispercpp.py) (Cython)\n  - [AIWintermuteAI\u002Fwhispercpp](https:\u002F\u002Fgithub.com\u002FAIWintermuteAI\u002Fwhispercpp) (Updated fork of aarnphm\u002Fwhispercpp)\n  - [aarnphm\u002Fwhispercpp](https:\u002F\u002Fgithub.com\u002Faarnphm\u002Fwhispercpp) (Pybind11)\n  - [abdeladim-s\u002Fpywhispercpp](https:\u002F\u002Fgithub.com\u002Fabdeladim-s\u002Fpywhispercpp) (Pybind11)\n- [x] R: [bnosac\u002Faudio.whisper](https:\u002F\u002Fgithub.com\u002Fbnosac\u002Faudio.whisper)\n- [x] Unity: [macoron\u002Fwhisper.unity](https:\u002F\u002Fgithub.com\u002FMacoron\u002Fwhisper.unity)\n\n## XCFramework\nThe XCFramework is a precompiled version of the library for iOS, visionOS, tvOS,\nand macOS. It can be used in Swift projects without the need to compile the\nlibrary from source. For example, the v1.7.5 version of the XCFramework can be\nused as follows:\n\n```swift\n\u002F\u002F swift-tools-version: 5.10\n\u002F\u002F The swift-tools-version declares the minimum version of Swift required to build this package.\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"Whisper\",\n    targets: [\n        .executableTarget(\n            name: \"Whisper\",\n            dependencies: [\n                \"WhisperFramework\"\n            ]),\n        .binaryTarget(\n            name: \"WhisperFramework\",\n            url: \"https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Freleases\u002Fdownload\u002Fv1.7.5\u002Fwhisper-v1.7.5-xcframework.zip\",\n            checksum: \"c7faeb328620d6012e130f3d705c51a6ea6c995605f2df50f6e1ad68c59c6c4a\"\n        )\n    ]\n)\n```\n\n## Voice Activity Detection (VAD)\nSupport for Voice Activity Detection (VAD) can be enabled using the `--vad`\nargument to `whisper-cli`. In addition to this option a VAD model is also\nrequired.\n\nThe way this works is that first the audio samples are passed through\nthe VAD model which will detect speech segments. Using this information,\nonly the speech segments that are detected are extracted from the original audio\ninput and passed to whisper for processing. This reduces the amount of audio\ndata that needs to be processed by whisper and can significantly speed up the\ntranscription process.\n\nThe following VAD models are currently supported:\n\n### Silero-VAD\n[Silero-vad](https:\u002F\u002Fgithub.com\u002Fsnakers4\u002Fsilero-vad) is a lightweight VAD model\nwritten in Python that is fast and accurate.\n\nModels can be downloaded by running the following command on Linux or MacOS:\n```console\n$ .\u002Fmodels\u002Fdownload-vad-model.sh silero-v6.2.0\nDownloading ggml model silero-v6.2.0 from 'https:\u002F\u002Fhuggingface.co\u002Fggml-org\u002Fwhisper-vad' ...\nggml-silero-v6.2.0.bin        100%[==============================================>] 864.35K  --.-KB\u002Fs    in 0.04s\nDone! Model 'silero-v6.2.0' saved in '\u002Fpath\u002Fmodels\u002Fggml-silero-v6.2.0.bin'\nYou can now use it like this:\n\n  $ .\u002Fbuild\u002Fbin\u002Fwhisper-cli -vm \u002Fpath\u002Fmodels\u002Fggml-silero-v6.2.0.bin --vad -f samples\u002Fjfk.wav -m models\u002Fggml-base.en.bin\n\n```\nAnd the following command on Windows:\n```console\n> .\\models\\download-vad-model.cmd silero-v6.2.0\nDownloading vad model silero-v6.2.0...\nDone! Model silero-v6.2.0 saved in C:\\Users\\danie\\work\\ai\\whisper.cpp\\ggml-silero-v6.2.0.bin\nYou can now use it like this:\n\nC:\\path\\build\\bin\\Release\\whisper-cli.exe -vm C:\\path\\ggml-silero-v6.2.0.bin --vad -m models\u002Fggml-base.en.bin -f samples\\jfk.wav\n\n```\n\nTo see a list of all available models, run the above commands without any\narguments.\n\nThis model can be also be converted manually to ggml using the following command:\n```console\n$ python3 -m venv venv && source venv\u002Fbin\u002Factivate\n$ (venv) pip install silero-vad\n$ (venv) $ python models\u002Fconvert-silero-vad-to-ggml.py --output models\u002Fsilero.bin\nSaving GGML Silero-VAD model to models\u002Fsilero-v6.2.0-ggml.bin\n```\nAnd it can then be used with whisper as follows:\n```console\n$ .\u002Fbuild\u002Fbin\u002Fwhisper-cli \\\n   --file .\u002Fsamples\u002Fjfk.wav \\\n   --model .\u002Fmodels\u002Fggml-base.en.bin \\\n   --vad \\\n   --vad-model .\u002Fmodels\u002Fsilero-v6.2.0-ggml.bin\n```\n\n### VAD Options\n\n* --vad-threshold: Threshold probability for speech detection. A probability\nfor a speech segment\u002Fframe above this threshold will be considered as speech.\n\n* --vad-min-speech-duration-ms: Minimum speech duration in milliseconds. Speech\nsegments shorter than this value will be discarded to filter out brief noise or\nfalse positives.\n\n* --vad-min-silence-duration-ms: Minimum silence duration in milliseconds. Silence\nperiods must be at least this long to end a speech segment. Shorter silence\nperiods will be ignored and included as part of the speech.\n\n* --vad-max-speech-duration-s: Maximum speech duration in seconds. Speech segments\nlonger than this will be automatically split into multiple segments at silence\npoints exceeding 98ms to prevent excessively long segments.\n\n* --vad-speech-pad-ms: Speech padding in milliseconds. Adds this amount of padding\nbefore and after each detected speech segment to avoid cutting off speech edges.\n\n* --vad-samples-overlap: Amount of audio to extend from each speech segment into\nthe next one, in seconds (e.g., 0.10 = 100ms overlap). This ensures speech isn't\ncut off abruptly between segments when they're concatenated together.\n\n## Examples\n\nThere are various examples of using the library for different projects in the [examples](examples) folder.\nSome of the examples are even ported to run in the browser using WebAssembly. Check them out!\n\n| Example                                             | Web                                   | Description                                                                                                                     |\n| --------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| [whisper-cli](examples\u002Fcli)                         | [whisper.wasm](examples\u002Fwhisper.wasm) | Tool for translating and transcribing audio using Whisper                                                                       |\n| [whisper-bench](examples\u002Fbench)                     | [bench.wasm](examples\u002Fbench.wasm)     | Benchmark the performance of Whisper on your machine                                                                            |\n| [whisper-stream](examples\u002Fstream)                   | [stream.wasm](examples\u002Fstream.wasm)   | Real-time transcription of raw microphone capture                                                                               |\n| [whisper-command](examples\u002Fcommand)                 | [command.wasm](examples\u002Fcommand.wasm) | Basic voice assistant example for receiving voice commands from the mic                                                         |\n| [whisper-server](examples\u002Fserver)                   |                                       | HTTP transcription server with OAI-like API                                                                                     |\n| [whisper-talk-llama](examples\u002Ftalk-llama)           |                                       | Talk with a LLaMA bot                                                                                                           |\n| [whisper.objc](examples\u002Fwhisper.objc)               |                                       | iOS mobile application using whisper.cpp                                                                                        |\n| [whisper.swiftui](examples\u002Fwhisper.swiftui)         |                                       | SwiftUI iOS \u002F macOS application using whisper.cpp                                                                               |\n| [whisper.android](examples\u002Fwhisper.android)         |                                       | Android mobile application using whisper.cpp                                                                                    |\n| [whisper.nvim](examples\u002Fwhisper.nvim)               |                                       | Speech-to-text plugin for Neovim                                                                                                |\n| [generate-karaoke.sh](examples\u002Fgenerate-karaoke.sh) |                                       | Helper script to easily [generate a karaoke video](https:\u002F\u002Fyoutu.be\u002Fuj7hVta4blM) of raw audio capture                           |\n| [livestream.sh](examples\u002Flivestream.sh)             |                                       | [Livestream audio transcription](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fissues\u002F185)                                            |\n| [yt-wsp.sh](examples\u002Fyt-wsp.sh)                     |                                       | Download + transcribe and\u002For translate any VOD [(original)](https:\u002F\u002Fgist.github.com\u002FDaniruKun\u002F96f763ec1a037cc92fe1a059b643b818) |\n| [wchess](examples\u002Fwchess)                           | [wchess.wasm](examples\u002Fwchess)        | Voice-controlled chess                                                                                                          |\n\n## [Discussions](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions)\n\nIf you have any kind of feedback about this project feel free to use the Discussions section and open a new topic.\nYou can use the [Show and tell](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002Fcategories\u002Fshow-and-tell) category\nto share your own projects that use `whisper.cpp`. If you have a question, make sure to check the\n[Frequently asked questions (#126)](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fwhisper.cpp\u002Fdiscussions\u002F126) discussion.\n","whisper.cpp 是一个用 C\u002FC++ 实现的 OpenAI 的 Whisper 自动语音识别模型。项目提供了一个高性能、无依赖的推理实现，支持多种架构优化如 ARM NEON、AVX 和 VSX 指令集，并且兼容苹果硅芯片及多种 GPU 加速方案（包括 Vulkan、NVIDIA、OpenVINO 等）。此外，它还支持混合精度计算、整数量化以及零运行时内存分配等特性。适用于需要在不同平台上进行离线语音转文字的应用场景，比如移动设备上的语音助手或嵌入式系统中对实时性要求较高的语音处理任务。",2,"2026-06-11 02:38:59","top_all"]