Galosoft.IaaS.WhisperNet 25.1.16.2-nj

This is a prerelease version of Galosoft.IaaS.WhisperNet.
dotnet add package Galosoft.IaaS.WhisperNet --version 25.1.16.2-nj                
NuGet\Install-Package Galosoft.IaaS.WhisperNet -Version 25.1.16.2-nj                
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="Galosoft.IaaS.WhisperNet" Version="25.1.16.2-nj" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Galosoft.IaaS.WhisperNet --version 25.1.16.2-nj                
#r "nuget: Galosoft.IaaS.WhisperNet, 25.1.16.2-nj"                
#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 Galosoft.IaaS.WhisperNet as a Cake Addin
#addin nuget:?package=Galosoft.IaaS.WhisperNet&version=25.1.16.2-nj&prerelease

// Install Galosoft.IaaS.WhisperNet as a Cake Tool
#tool nuget:?package=Galosoft.IaaS.WhisperNet&version=25.1.16.2-nj&prerelease                

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

                using var processor = whisperFactory.CreateBuilder()
                .WithLanguage("auto")
                .Build();

                var stringBuilder = new StringBuilder();
                if (System.IO.Path.GetExtension(fileName).Equals(".mp3", StringComparison.OrdinalIgnoreCase))
                {
                    using var stream = new MemoryStream();
                    using var mp3FileReader = new Mp3FileReader(fileName);
                    // Create a WaveFormatConversionStream to convert MP3 to WAV
                    var pcmStream = WaveFormatConversionStream.CreatePcmStream(mp3FileReader);

                    // Resample the PCM stream to 16kHz
                    var resampler = new WdlResamplingSampleProvider(pcmStream.ToSampleProvider(), 16000);

                    // Write the resampled WAV data to a memory stream
                    WaveFileWriter.WriteWavFileToStream(stream, resampler.ToWaveProvider16());
                    stream.Seek(0, SeekOrigin.Begin);

                    await foreach (var result in processor.ProcessAsync(stream))
                    {
                        stringBuilder.AppendLine(result.Text);

                        Speech2Text = stringBuilder.ToString();
                    }
                    stringBuilder.Clear();
                    return;
                }

                using var fileStream = File.OpenRead(fileName);

                await foreach (var result in processor.ProcessAsync(fileStream))
                {
                    stringBuilder.AppendLine(result.Text);

                    Speech2Text = stringBuilder.ToString();
                }
                stringBuilder.Clear();
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
25.1.16.2-nj 36 1/16/2025