Whisper.net 1.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Whisper.net --version 1.4.0
NuGet\Install-Package Whisper.net -Version 1.4.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="Whisper.net" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Whisper.net --version 1.4.0
#r "nuget: Whisper.net, 1.4.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.
// Install Whisper.net as a Cake Addin
#addin nuget:?package=Whisper.net&version=1.4.0

// Install Whisper.net as a Cake Tool
#tool nuget:?package=Whisper.net&version=1.4.0

Whisper.net

Open-Source Whisper.net

Dotnet bindings for OpenAI Whisper made possible by [whisper.cpp] (https://github.com/ggerganov/whisper.cpp)

Getting started

To install Whisper.net, run the following command in the Package Manager Console:

PM> Install-Package Whisper.net
PM> Install-Package Whisper.net.Runtime

or simply add a package reference in your csproj:

    <PackageReference Include="Whisper.net" Version="1.4.0" />
    <PackageReference Include="Whisper.net.Runtime" Version="1.4.0" />

Runtime

The runtime package, Whisper.net.Runtime, contains the native whisper.cpp library and it is required in order to run Whisper.net.

Versioning

Each version of Whisper.net is tied to a specific version of Whisper.cpp. The version of Whisper.net is the same as the version of Whisper it is based on. For example, Whisper.net 1.2.0 is based on Whisper 1.2.0.

However, there can be cases where Whisper.net patch version is incremented without a corresponding Whisper.cpp version change. This is the case when the changes in Whisper.net are not related to the changes in Whisper.cpp.

Ggml Models

Whisper.net uses Ggml models to perform speech recognition and translation.

You can find more about Ggml models here

Also, for easier integration Whisper.net provides a Downloader which is using https://huggingface.co.


    var modelName = "ggml-base.bin";
    if (!File.Exists(modelName))
    {
        using var modelStream = await WhisperGgmlDownloader.GetGgmlModelAsync(GgmlType.Base);
        using var fileWriter = File.OpenWrite(modelName);
        await modelStream.CopyToAsync(fileWriter);
    }

Usage


    using var whisperFactory = WhisperFactory.FromPath("ggml-base.bin");

    using var processor = whisperFactory.CreateBuilder()
        .WithSegmentEventHandler(OnNewSegment)
        .WithFileModel("ggml-base.bin")
        .WithTranslate()
        .WithLanguage("auto")
        .Build();

    void OnNewSegment(object sender, OnSegmentEventArgs e)
    {
        Console.WriteLine($"CSSS {e.Start} ==> {e.End} : {e.Segment}");
    }

    using var fileStream = File.OpenRead("yourAudio.wav");
    processor.Process()

Documentation

You can find the documentation and code samples here: https://github.com/sandrohanea/whisper.net

License

MIT Licence https://github.com/sandrohanea/whisper.net/blob/main/LICENSE

Supported platforms

Whisper.net is supported on the following platforms:

  • Windows x86
  • Windows x64
  • Windows ARM64
  • Windows ARM
  • Linux x64
  • Linux ARM64
  • Linux ARM
  • macOS x64
  • macOS ARM64 (Apple Silicon)
  • Android
  • iOS
  • MacCatalyst
  • tvOS
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-android31.0 is compatible.  net6.0-ios was computed.  net6.0-ios16.1 is compatible.  net6.0-maccatalyst was computed.  net6.0-maccatalyst16.1 is compatible.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-tvos16.1 is compatible.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Whisper.net:

Package Downloads
EachShow.AI

OpenAI, ChatGPT

LangChain.Providers.WhisperNet

OpenAI Whisper STT Provider using Whisper.Net library

BagheeraTranscriber

Package Description

Bagheera.Transcriber

Package Description

SharpSpeech

This library allows you to use crossplatform(Windows, Linux, MacOS) speech recognition. It also has support for wake word. It uses Whisper for recognizing text in speech and ffmpeg for recording audio.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.0 13,775 11/25/2023
1.4.7 4,802 9/2/2023
1.4.6 2,704 7/2/2023
1.4.5 785 6/19/2023
1.4.4 204 6/18/2023
1.4.3 1,046 5/27/2023
1.4.2 362 5/20/2023
1.4.0 898 5/1/2023
1.3.0 339 4/29/2023
1.2.2 1,409 3/26/2023
1.2.1 806 2/21/2023
1.2.1-preview4 151 2/16/2023
1.2.1-preview3 103 2/16/2023
1.2.1-preview2 150 2/14/2023
1.2.1-preview1 135 2/14/2023
1.2.0 1,771 2/4/2023