Skip to content
Lqm1Public

About

Rust SHIRO speech toolkit with C ABI and WebAssembly bindings

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

shiro-rs

This repository is a Cargo workspace containing shiro-rs, shiro-rs-capi, shiro-rs-wasm, shiro-rs-node and shiro-rs-python under crates/. See workspace layout for package selection, artifact names and binding commands. See workspace split verification for migration checks and their scope.

Native Node.js and Python packages are implemented with napi-rs and PyO3. See Node.js, Python and native binding verification. Builds and tests do not publish packages.

An idiomatic Rust reimplementation of the complete SHIRO toolkit, including its original C and Lua workflows. Upstream: https://github.com/Sleepwalking/SHIRO.

The native Rust phase passes the agreed five-target acceptance gate. C ABI and browser/Node.js WebAssembly bindings are implemented. See C API, WASM API and cross-crate speech verification for invocation and coverage. The complete accepted native and binding gates pass. See requirements verification and latest execution checkpoint for exact evidence and deferred targets.

The native package uses the complete ciglet-rs and liblrhsmm-rs Rust implementations.

Typed model definitions and shiro-mkhsmm -c modeldef.json are implemented, with binary output checked against the original C tool. The feature API now implements MFCC/MFBE/PLPCC with DC/energy and dynamic features, compared to the original xxcc pipeline. The shiro-xxcc command retains the original options and reads rawfloat files or piped stdin, writing rawfloat features to stdout. The shiro-wav2raw command reads WAV files, normalizes, dithers and resamples before writing rawfloat. It retains the original Windows/Linux GNU default dither sequences, corrects silent normalization, and provides explicit legacy resampling and opt-in seeded Rust dither. See docs/audio-compatibility.md for measured differences. The native shiro-wavsplit pipeline now trains and aligns utterances with in-memory audio/feature processing and original intermediate files. See docs/utterance-compatibility.md for measured comparisons and remaining edge cases. Real CMU SLT recordings now exercise feature extraction, supplied historical-model inference, fresh initialization, and HMM/HSMM training with save/reload inference. See docs/real-audio-compatibility.md for corpus licensing, numerical limits, and independent C/Lua reproduction.

The three projects remain independent Git repositories. Each contains its own three-package workspace.

shiro-fextr now handles indexed WAV conversion and all three bundled xxcc extractors in Rust. The bundled SPTK workflow and custom Lua callbacks have host adapters. See docs/batch-compatibility.md for presets, original options, compatibility corrections, numerical comparisons and host verification limits. shiro-lab2seg and shiro-seg2lab implement timed label conversion and phoneme/state alignment output. See docs/label-compatibility.md for the original rounding, grouping, JSON schema and decimal-format differences. shiro-mkpm, shiro-pm2md and shiro-mkseg implement phone-set expansion, model definitions and equally spaced segmentation with the original phone topologies and skip probabilities. See docs/phonemap-compatibility.md for Lua/C comparisons and the corrected shared-duration constraint handling. shiro-init supports aligned and flat initialization, global emission tying, model-shaped rawfloat loading and relative variance floors. The original C models compare byte for byte on the reference corpus, with documented fixes for malformed feature files and multi-file fallback duration statistics. See docs/initialization-compatibility.md.

shiro-align supports embedded and isolated HMM/HSMM alignment, original pruning options and metadata-preserving JSON output. See docs/alignment-compatibility.md for C paths and corrected isolated boundaries.

shiro-untie creates independent model distributions for every corpus state, rewrites segmentation references and exports the original correspondence summary. Stream weights are retained, correcting their loss in the C tool. See docs/untying-compatibility.md for byte comparisons and validation.

The training module implements HMM/HSMM re-estimation, DAEM scheduling, convergence, grouped-file likelihood reports and deterministic parallel statistics reduction. See docs/training-compatibility.md. The shiro-rest CLI supports all original options, binary stdout/stdin and likelihood CSV export.

cargo test
cargo clippy --all-targets -- -D warnings

Licensed under GPL-3.0-or-later. SHIRO source is copyright 2017-2018 Kanru Hua. Audited upstream commit: 203ef7b71bf382c8b5ce3f86b8116f63265e2711.

Release checkpoints, package names and owner setup steps are documented in the release procedure.

About

Rust SHIRO speech toolkit with C ABI and WebAssembly bindings

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages