GithubHelp home page GithubHelp logo

vrcwizard / whisper.naudio.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awesomeyuer/whisper.naudio.net

0.0 0.0 0.0 8.44 MB

Whisper.net. Speech to text made simple using Whisper Models (naudio)

License: MIT License

C# 92.94% PowerShell 6.56% CMake 0.50%

whisper.naudio.net's Introduction

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

or simply add a package reference in your csproj:

    <PackageReference Include="Whisper.net" Version="1.2.2" />

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.