tryAGI.Chimera 0.2.0-preview.2

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

tryAGI.Chimera

A C# / .NET 10 SDK for CHIMERA, the MIT-licensed physical-modeling voice and singing engine in Rust. This is a CPU-based synthesizer: no cloud account, model download, or GPU is required.

The package offers two distinct APIs:

  • ChimeraStreamingClient runs the native C ABI in process, emitting PCM16 mono / 48 kHz blocks immediately as rendering progresses. It never creates a WAV or spawns a process.
  • ChimeraClient preserves the original offline subprocess API for WAV output through the upstream chimera CLI.

Native PCM streaming

using Chimera;

var synth = new ChimeraStreamingClient(new ChimeraStreamingOptions
{
    FramesPerChunk = 1024, // About 21 ms of audio per block at 48 kHz
    EnglishDictionaryPath = "/opt/chimera/cmudict.txt.gz",
});

await foreach (var chunk in synth.StreamTextAsync("Hello from CHIMERA."))
{
    // Write chunk.Pcm16 to the audio transport without collecting a WAV.
    await audioOutput.WriteAsync(chunk.Pcm16);
    Console.WriteLine($"Generated block at {chunk.ElapsedSinceRequest.TotalMilliseconds:F1} ms");
}

await foreach (var chunk in synth.StreamIpaAsync("ˈɑpɑ", ChimeraVoice.Female))
{
    await audioOutput.WriteAsync(chunk.Pcm16);
}

var notes = """
{
    "bpm": 120,
    "syllables": [{"text":"a","onset":[],"nucleus":{"ipa":"ɑ"},"coda":[]}],
    "notes": [[60, 1]]
}
""";
await foreach (var chunk in synth.StreamNotesAsync(notes))
{
    await audioOutput.WriteAsync(chunk.Pcm16);
}

The first emitted block's ElapsedSinceRequest is the measured time to first generated PCM block (not first audible sample or time to playback on the device). Each enumeration allocates its own native engine and frees it on completion or cancellation. The upstream engine's C ABI layout is verified at runtime; the SDK rejects incompatible layouts.

Russian: For Cyrillic speech, use StreamRussianTextAsync("Приве́т, мир!"); for sung lyrics supply "lang":"ru" and Cyrillic lyrics in the notes JSON. Both use the native Russian frontend without the English dictionary. Explicitly mark ambiguous stress with U+0301 (combining acute). This first speech path uses the Russian singing frontend, so unstressed vowel reduction is approximate.

English dictionary: StreamTextAsync requires a local CMU dictionary (text or gzip). The package does not redistribute dictionary data. IPA rendering and singing from explicit syllables work without this dictionary. Use StreamRussianTextAsync for Russian prose, not the English G2P frontend.

Native binaries and NuGet

The CI pipeline compiles upstream Rust revision 7c0f722e6a375f0acae543364565741d58c100c9 into platform-native chimera_wasm C ABI libraries and assembles a single multi-RID tryAGI.Chimera NuGet artifact:

Runtime Native library
linux-x64, linux-arm64 libchimera_wasm.so
osx-arm64, osx-x64 libchimera_wasm.dylib
win-x64 chimera_wasm.dll

These are placed under the standard runtimes/<RID>/native/ NuGet asset layout, so normal .NET runtime resolution finds the correct binary. For development with a locally built Rust library, set CHIMERA_NATIVE_PATH to its absolute path. The upstream chimera-wasm crate exposes a C ABI on native targets too; despite its name, it does not require WebAssembly at runtime.

Build the native library independently:

git clone https://github.com/jamesondh/chimera-vocal-synth.git
cargo build --locked --release --manifest-path chimera-vocal-synth/Cargo.toml -p chimera-wasm

For the release NuGet pack, CI passes ChimeraRequireNative=true and verifies that all five native assets exist. An unqualified local dotnet pack only produces a managed development package; use the CI artifact for all-platform native distribution. See third-party notices.

Offline WAV CLI compatibility

var cli = new ChimeraClient(new ChimeraClientOptions
{
    ExecutablePath = "/opt/chimera/target/release/chimera",
    Timeout = TimeSpan.FromSeconds(30),
});
ChimeraAudio wave = await cli.SynthesizeTextAsync("Hello world.");
await File.WriteAllBytesAsync("speech.wav", wave.WaveBytes);

Build CLI with cargo build --locked --release --manifest-path chimera-vocal-synth/Cargo.toml -p chimera-cli. The CLI needs upstream's original pronunciation dictionary at its source path; moving only the executable is insufficient.

Validation

dotnet test Chimera.slnx -c Release --filter "TestCategory!=Native&TestCategory!=NativeStreaming"
dotnet pack src/Chimera/Chimera.csproj -c Release

Native smoke tests (including spoken PCM, IPA, sung syllables and cancellation) run on Linux x64/arm64, macOS arm64/x64 and Windows x64 in GitHub Actions. Set CHIMERA_NATIVE_PATH and CHIMERA_DICTIONARY_PATH to run them locally. CLI smoke tests remain separate.

A real-time server should monitor synthesis request-to-first-PCM latency independently of the device's playback-start latency, and keep CHIMERA opt-in until voice/language compatibility is evaluated. tryAGI maintains the C# integration; the original CHIMERA engine belongs to its respective copyright holders.

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.2.0-preview.2 60 11/30/2026