---
title: "Run Whisper in C# without native libraries"
url: https://recursiveai.org/onespeech/cookbook/whisper-dotnet/
description: "Run Whisper in C# without native inference libraries. Use OneSpeech on .NET 10, choose a model, and run a complete downloadable example."
version: "1.0.0"
---

# Run Whisper in C# without native libraries

**OneSpeech** is a free, open-source speech recognition library for .NET from Recursive AI. MIT or Apache-2.0, no native dependencies.

[NuGet](https://www.nuget.org/packages/RecursiveAI.OneSpeech) · [GitHub](https://github.com/recursive-ai-oss/onespeech-csharp) · [Docs](https://recursiveai.org/onespeech/docs/) · [Download example (.zip)](https://recursiveai.org/onespeech/cookbook/whisper-dotnet/whisper-dotnet.zip)

Run Whisper on `sample.flac` (in the zip). First use downloads several GB of models.

```shell
dotnet add package RecursiveAI.OneSpeech
```

Requires [.NET 10](https://dotnet.microsoft.com/download/dotnet/10.0) (net10.0); .NET 9 and earlier aren’t supported.

```csharp
using OneSpeech;
var transcript = Speech.Transcribe(
    "sample.flac", language: "en",
    model: "openai/whisper-large-v3-turbo");
Console.WriteLine(transcript.Text);
```

Unzip [the example](https://recursiveai.org/onespeech/cookbook/whisper-dotnet/whisper-dotnet.zip), then `dotnet run`.

Prints:

```text
 stuffered into you, his belly counseled him.
```

This is the model’s real output on a real recording, mistake included; `word.Text.Trim()` removes a recognized word’s leading space.

The default recognizer is Whisper large-v3-turbo: its publisher weights are 1,617.8 MB (about 1.62 GB). This English run also loads Qwen3-ForcedAligner (1,835.5 MB of publisher weights) to time words and CAM++ English (29.4 MB) to group speakers; the built-in Silero detector finds speech. Converted runtime files take additional disk space. By default, models are cached in `%LOCALAPPDATA%/OneSpeech/models` on Windows, `~/Library/Caches/OneSpeech/models` on macOS, or `$XDG_CACHE_HOME/onespeech/models` on Linux (falling back to `~/.cache/onespeech/models`). `ONESPEECH_MODEL_CACHE` overrides that location. See [Model files and pre-fetch](https://recursiveai.org/onespeech/docs/models/) and the [download sizes](https://recursiveai.org/onespeech/docs/model-downloads/).

## The full program

The snippet at the top explicitly selects Whisper large-v3-turbo. The full program also prints the models and their licenses, including the extra models for word timing and speaker grouping.

The input `sample.flac` is the unmodified LibriSpeech test-clean recording 1089-134686-0001: “stuff it into you his belly counselled him”. It ships in the zip under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), credited to Vassil Panayotov, Guoguo Chen, Daniel Povey and Sanjeev Khudanpur ([LibriSpeech](https://www.openslr.org/12)).

```csharp
using OneSpeech;

Transcript transcript = Speech.Transcribe(
    "sample.flac", language: "en",
    model: "openai/whisper-large-v3-turbo");
Console.WriteLine(transcript.Text);
foreach (ModelInfo model in transcript.Models)
    Console.WriteLine($"{model.Id} ({model.License})");
```

`dotnet run` prints:

```text
 stuffered into you, his belly counseled him.
silero/vad-v6.2.3 (MIT)
openai/whisper-large-v3-turbo (MIT)
Qwen/Qwen3-ForcedAligner-0.6B (Apache-2.0)
iic/speech_campplus_sv_en_voxceleb_16k (Apache-2.0)
```

This is the recognizer’s actual output, including its “stuffered” mistake and leading spaces. Missing models download on first use; subsequent runs reuse verified cache files.

Invalid encoded audio throws `UnsupportedAudioException`; model download or integrity failures are reported as typed model errors.

## Variations

**Whisper from an encoded stream.** This selects the same recognizer explicitly and keeps ownership of the input stream in your application. Use the same `sample.flac` from the zip.

```csharp
using OneSpeech;

await using var input = File.OpenRead("sample.flac");
var transcript = await Speech.TranscribeAsync(input,
    language: "en", model: "openai/whisper-large-v3-turbo");
Console.WriteLine(transcript.Text);
```

```text
 stuffered into you, his belly counseled him.
```

**Download only Whisper.** This fetches and verifies the selected model’s files without loading recognition or downloading the word-timing and speaker models. It does not prepare the full transcription program for offline use.

```csharp
using OneSpeech.Catalog;

var store = new ModelStore();
await store.PullAsync("openai/whisper-large-v3-turbo");
Console.WriteLine("Whisper files ready");
```

```text
Whisper files ready
```

## Related recipes

- [Speech to text in C#](https://recursiveai.org/onespeech/cookbook/speech-to-text/)
- [Transcribe an audio file in C#](https://recursiveai.org/onespeech/cookbook/transcribe-audio-file/)
- [Generate SRT subtitles from audio in C#](https://recursiveai.org/onespeech/cookbook/generate-subtitles-from-audio/)
- [Get speech-to-text word timestamps in C#](https://recursiveai.org/onespeech/cookbook/word-timestamps/)

## The short answer

OneSpeech runs Whisper in C# on .NET 10 without a native inference runtime. Install `RecursiveAI.OneSpeech` and call `Speech.Transcribe` with a catalog model ID such as `openai/whisper-large-v3-turbo`. OneModel is the .NET model-execution library; OneAudio is the .NET audio-decoding and resampling library. You don’t need a separately deployed native runtime package for this example.

The model ID makes the choice explicit. Leaving it out currently selects the same turbo file recognizer. The returned `Transcript.Models` shows every model that participated, not just the recognizer you named. In this run, VAD, alignment and speaker embedding also participated, which is why the printed list is longer than one entry.

## How do I use Whisper in C# without native libraries?

Use the managed path in the snippet at the top. The published core package and its OneAudio and OneModel dependencies contain managed .NET libraries, not native inference assets. That changes deployment packaging; it is not a claim about performance on your hardware. Test the application with the recordings, memory budget and concurrency you intend to use.

Whisper large-v3-turbo is the file default. The catalog also has tiny, base, small and large-v3 variants. Selection does not silently substitute a different model, and large-v3 needs substantially more memory than turbo. A call can also acquire alignment and embedding models, so the recognizer’s weight size alone is not the whole memory or disk budget. The [Whisper documentation](https://recursiveai.org/onespeech/docs/whisper-features/) describes the decoding options and the documented scope of its comparisons.

## Can I use Whisper offline in .NET?

Yes, once the required catalog files are present. On first use, missing model files come from pinned publisher revisions, with size and SHA-256 checks. Verified publisher weights can be converted locally into the runtime graphs; conversion needs temporary storage. Existing verified runtime files are reused without network requests. The zip deliberately does not embed several GB of weights.

The whole-file helper selects separate models for recognition, word timing and speaker grouping. Preparing only Whisper does not necessarily prepare word timing or speaker clustering. Use the [first-use model table](https://recursiveai.org/onespeech/docs/model-downloads/) when preparing an offline host, and direct `ONESPEECH_MODEL_CACHE` to a trusted per-user model directory. The stream variation changes how audio enters the pipeline, not which model files recognition requires.

## Can I load a Whisper GGUF model in C#?

The example uses a catalog ID, not a GGUF path. OneSpeech’s documented catalog route fetches pinned publisher files and produces its own verified runtime graphs. Its low-level directory and graph constructors require the documented family graph format. A downloaded Whisper file from a different runtime is not interchangeable just because the model has the same name.

For the task shown here, use the catalog loader rather than renaming a model file or passing a foreign binary to `Speech.Transcribe`. The [loading documentation](https://recursiveai.org/onespeech/docs/loading/) separates catalog models from manually converted and custom graphs. This keeps the runtime format, tokenizer and configuration together and records the actual model provenance in the transcript.

Recognition output is still an estimate. Our short sample contains a word error, and word timing can fail independently of recognition. A timed word is not proof that the recognizer’s spelling was correct. Use the text for transcription, inspect `TimingMethod` when working with timestamps, and retain JSON if later processing needs those distinctions.
