PiperSharp 1.0.5

dotnet add package PiperSharp --version 1.0.5
                    
NuGet\Install-Package PiperSharp -Version 1.0.5
                    
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="PiperSharp" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PiperSharp" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="PiperSharp" />
                    
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 PiperSharp --version 1.0.5
                    
#r "nuget: PiperSharp, 1.0.5"
                    
#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.
#addin nuget:?package=PiperSharp&version=1.0.5
                    
Install PiperSharp as a Cake Addin
#tool nuget:?package=PiperSharp&version=1.0.5
                    
Install PiperSharp as a Cake Tool

PiperSharp TTS

NuGet Version dotnet License: MIT

A simple C# wrapper of piper TTS application. Similar to piper you can checkout models here and models from huggingface, checkout PiperDownloader usage.

Usage

See examples for example usage or tests.

// To download piper executable use

var cwd = Directory.GetCurrentDirectory();
await PiperDownloader.DownloadPiper().ExtractPiper(cwd); // Downloads and extracts piper to cwd/piper directory
...
// You can get list of models from hugging face using
var models = await PiperDownloader.GetHuggingFaceModelList(); // Returns a dictionary with model key as key
var model = models["ar_JO-kareem-low"];

// or you can do
var model = await PiperDownloader.GetModelByKey("ar_JO-kareem-low");
...
// Before you can use the model you need to download it using
model = await model.DownloadModel(cwd);
// Or if its downloaded you can load it from directory
model = await VoiceModel.LoadModel(modelPath);

// Now you can also do
model = await PiperDownloader.DownloadModelByKey("ar_JO-kareem-low");
// Or if its downloaded you can load it by key aswell
model = await VoiceModel.LoadModelByKey("ar_JO-kareem-low");
...
// To start generating audio use PiperProvider
var piperModel = new PiperProvider(new PiperConfiguration()
{
    ExecutableLocation = Path.Join(cwd, "piper", "piper.exe"), // Path to piper executable
    WorkingDirectory = Path.Join(cwd, "piper"), // Path to piper working directory
    Model = model, // Loaded/downloaded VoiceModel
});

// Generate audio, currently supported formats are Mp3, Wav, Raw
var result = await piperModel.InferAsync("Hello there!", AudioOutputType.Wav); // Returns byte[]

If you want to report bugs do it here: https://github.com/Lyx52/PiperSharp/issues

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  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.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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

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
1.0.5 480 9/12/2024
1.0.4 196 7/26/2024
1.0.3 188 5/7/2024
1.0.2 155 3/16/2024
1.0.1 135 3/10/2024
1.0.0 152 3/9/2024