ElBruno.Whisper 0.2.0

dotnet add package ElBruno.Whisper --version 0.2.0
                    
NuGet\Install-Package ElBruno.Whisper -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ElBruno.Whisper" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ElBruno.Whisper" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="ElBruno.Whisper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ElBruno.Whisper --version 0.2.0
                    
#r "nuget: ElBruno.Whisper, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ElBruno.Whisper@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ElBruno.Whisper&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=ElBruno.Whisper&version=0.2.0
                    
Install as a Cake Tool

ElBruno.Whisper

NuGet NuGet Downloads Build Status License: MIT HuggingFace .NET GitHub stars Twitter Follow

Run local Whisper speech-to-text in .NET ๐ŸŽค

Transcribe audio to text in .NET using OpenAI's Whisper model. Powered by ONNX Runtime with automatic model download from HuggingFace.

Features

  • ๐Ÿ“ฆ Automatic model download โ€” models are fetched from HuggingFace on first use
  • ๐Ÿ”Š Multiple model sizes โ€” tiny โ†’ base โ†’ small โ†’ medium โ†’ large (pick your speed/accuracy tradeoff)
  • ๐Ÿš€ Zero friction โ€” works out of the box with sensible defaults (tiny.en)
  • ๐ŸŒ Multilingual support โ€” transcribe 99+ languages with multilingual models
  • ๐Ÿ’‰ DI-friendly โ€” register with AddWhisper() in ASP.NET Core
  • ๐Ÿ“Š Progress reporting โ€” track model downloads with real-time callbacks
  • ๐ŸŽฏ English-optimized models โ€” dedicated .en variants for best accuracy on English audio

Installation

dotnet add package ElBruno.Whisper

Quick Start

using ElBruno.Whisper;

// Create client (downloads tiny.en model on first run)
using var client = await WhisperClient.CreateAsync();

var result = await client.TranscribeAsync("audio.wav");
Console.WriteLine(result.Text);

First Run

The first time you create a WhisperClient, the model is downloaded from HuggingFace to your local cache directory (~75 MB - 3 GB depending on model size). This typically takes 10-60 seconds depending on your internet connection and chosen model.

Track download progress:

using var client = await WhisperClient.CreateAsync(
    progress: new Progress<ElBruno.HuggingFace.DownloadProgress>(p =>
    {
        if (p.Stage == ElBruno.HuggingFace.DownloadStage.Downloading)
            Console.WriteLine($"{p.CurrentFile}: {p.PercentComplete:F0}%");
        else
            Console.WriteLine($"{p.Stage}: {p.Message}");
    })
);

Subsequent runs load instantly from cache (%LOCALAPPDATA%/ElBruno/Whisper/models).

Model Selection

Whisper offers various model sizes. English-optimized models (.en suffix) are smaller and faster for English audio:

using var client = await WhisperClient.CreateAsync(new WhisperOptions
{
    Model = KnownWhisperModels.WhisperSmallEn
});

var result = await client.TranscribeAsync("english-audio.wav");
Console.WriteLine(result.Text);

Available Models

Size English Multilingual Parameters Approx Size Speed
tiny tiny.en tiny 39M 75 MB โšกโšกโšกโšกโšก
base base.en base 74M 140 MB โšกโšกโšกโšก
small small.en small 244M 460 MB โšกโšกโšก
medium medium.en medium 769M 1.5 GB โšกโšก
large โ€” large 1550M 3.0 GB โšก

Use English-optimized (.en) models for:

  • English audio only (slightly smaller, faster, better accuracy on English)

Use Multilingual models for:

  • Non-English audio
  • Mixed-language content
  • Language auto-detection

Progress Tracking

Monitor both file downloads and transcription progress:

var downloadProgress = new Progress<ElBruno.HuggingFace.DownloadProgress>(p =>
{
    if (p.Stage == ElBruno.HuggingFace.DownloadStage.Downloading)
        Console.Write($"\rโฌ‡๏ธ {p.PercentComplete:F0}%");
    else
        Console.WriteLine($"\nโœ“ {p.Message}");
});

using var client = await WhisperClient.CreateAsync(progress: downloadProgress);

var result = await client.TranscribeAsync("audio.wav");
Console.WriteLine($"โœ“ Transcribed: {result.Text}");

Dependency Injection

Register Whisper in ASP.NET Core or other DI-enabled applications:

builder.Services.AddWhisper(options =>
{
    options.Model = KnownWhisperModels.WhisperBaseEn;
});

// Inject WhisperClient anywhere
public class TranscriptionService(WhisperClient whisper) { ... }

Transcription Result

The TranscriptionResult includes:

var result = await client.TranscribeAsync("audio.wav");

Console.WriteLine(result.Text);                    // Transcribed text
Console.WriteLine(result.DetectedLanguage);       // Detected language (for multilingual models)
Console.WriteLine(result.Duration);               // Audio duration

Troubleshooting

Model download fails?

  • Check your internet connection
  • For private HuggingFace models, set the HF_TOKEN environment variable

Out of memory?

  • Use a smaller model (tiny or base instead of medium/large)
  • Transcribe shorter audio files in chunks

For detailed troubleshooting, see docs.

Samples

Sample Description
HelloWhisper Minimal console transcription
BlazorWhisper Blazor app with audio recording and real-time transcription

Documentation

Building from Source

git clone https://github.com/elbruno/ElBruno.Whisper
cd ElBruno.Whisper
dotnet build ElBruno.Whisper.slnx
dotnet test ElBruno.Whisper.slnx --filter "Category!=Integration"

Testing

The repository includes comprehensive unit and integration tests:

Quick test run (unit tests, no model download):

dotnet test ElBruno.Whisper.slnx --filter "Category!=Integration"

Full test run (includes integration with real models):

dotnet test ElBruno.Whisper.slnx

Test audio files are provided in testdata/audio/ for validation and transcription testing. For details, see the Testing Guide.

๐Ÿค Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ‘‹ About the Author

Made with โค๏ธ by Bruno Capuano (ElBruno)

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ElBruno.Whisper:

Package Downloads
ElBruno.MarkItDotNet.Whisper

Local audio transcription for ElBruno.MarkItDotNet using OpenAI Whisper via ONNX Runtime. Converts audio files to Markdown transcripts offline.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 46 4/11/2026
0.1.6 45 4/10/2026
0.1.5 205 4/2/2026
0.1.2 91 3/30/2026
0.1.1 77 3/30/2026
0.1.0 86 3/30/2026