PhonemizerSharp 0.1.1

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

PhonemizerSharp

A .NET library for converting text into phoneme sequences. Suitable for TTS engines, speech processing, and natural language applications.

In plain terms: you give it words or sentences, and it returns the sounds for that text using IPA phonemes. That makes it useful for text-to-speech tools, speech experiments, pronunciation helpers, alignment workflows, and any project where written text needs to become a sound-oriented representation.

The current implementation uses eSpeak NG under the hood. On Windows x64, the native eSpeak NG library and data files are bundled with the project, so the default runtime does not require a separate eSpeak NG install.

What It Does

  • Converts text into IPA phoneme output.
  • Supports eSpeak NG language and voice codes such as en-us and en-gb.
  • Provides a simple async API through PhonemizerService.
  • Uses the bundled native eSpeak NG runtime by default on Windows x64.
  • Also includes an optional process runtime if you want to call an external espeak-ng executable.

Quick Start

Reference the project from your app, then call PhonemizeAsync:

using PhonemizerSharp.Application;
using PhonemizerSharp.Domain.Requests;

using PhonemizerService phonemizer = new();

var result = await phonemizer.PhonemizeAsync(new PhonemizerRequest
{
    Text = "Hello world",
    Language = "en-us"
});

Console.WriteLine(result.Phonemes);

The result includes the original text, phonemes, language, alphabet, provider, runtime, and provider name.

Requirements

  • .NET 10 SDK
  • Windows x64 for the bundled native eSpeak NG runtime

For the default Windows x64 path, no extra eSpeak NG installation is needed. The project copies libespeak-ng.dll and espeak-ng-data into the build output.

For other platforms, install libespeak-ng and make sure it can be found by the operating system loader, or set EspeakNgProviderSettings.NativeLibraryPath and DataPath.

If you choose PhonemizerRuntime.Process, PhonemizerSharp launches an external espeak-ng executable. In that mode, espeak-ng must be available on PATH, or you must set EspeakNgProviderSettings.ExecutablePath.

Choosing a Runtime

By default, PhonemizerService uses PhonemizerRuntime.Auto, which currently selects the native eSpeak NG runtime.

Use the default service for the bundled native runtime:

using PhonemizerSharp.Application;

using PhonemizerService phonemizer = new();

Use the process runtime only when you specifically want to call an external espeak-ng executable:

using PhonemizerSharp.Application;
using PhonemizerSharp.Domain.Settings;
using PhonemizerSharp.Domain.Settings.Enums;

using PhonemizerService phonemizer = new(new PhonemizerSettings
{
    Runtime = PhonemizerRuntime.Process,
    EspeakNg =
    {
        ExecutablePath = "espeak-ng",
        DefaultLanguage = "en-us",
        TimeoutInSeconds = 30
    }
});

Configuration

PhonemizerRequest:

Property Default Description
Text "" Text to phonemize. Blank text is rejected.
Language "" eSpeak NG language or voice. Falls back to the provider default.
Alphabet Ipa Output alphabet. IPA is the only supported alphabet today.

EspeakNgProviderSettings:

Property Default Description
ExecutablePath espeak-ng Executable used by the process runtime.
NativeLibraryPath "" Optional explicit path to libespeak-ng.
DataPath "" Optional eSpeak NG data path.
DefaultLanguage en-us Language used when a request does not specify one.
IpaMode 3 eSpeak NG IPA mode.
TimeoutInSeconds 30 Process runtime timeout. Values less than or equal to zero disable the timeout.
Quiet true Adds -q when using the process runtime.

Build and Test

From the repository root:

dotnet build .\src\PhonemizerSharp\PhonemizerSharp.slnx
dotnet test .\src\PhonemizerSharp\PhonemizerSharp.slnx

Some tests exercise live eSpeak NG behavior. The native live tests can use the bundled Windows x64 assets. The process live tests require an espeak-ng executable.

To skip live eSpeak NG tests:

dotnet test .\src\PhonemizerSharp\PhonemizerSharp.slnx --filter "TestCategory!=LiveEspeakNg&TestCategory!=LiveEspeakNgNative"

Repository Layout

src/
  PhonemizerSharp/
    PhonemizerSharp.slnx
    PhonemizerSharp/
      PhonemizerSharp.csproj
    PhonemizerSharp.Ut/
      PhonemizerSharp.Ut.csproj

License

PhonemizerSharp is licensed under the Apache License 2.0. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

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
0.1.1 148 7/5/2026
0.1.0 118 7/5/2026