Commit Graph
2181 Commits
Author SHA1 Message Date
Anmol Guragain f7bef43536 Fix endpointing for streaming T-one (#4157)
I ran into this while writing the Rust T-one example. With
enable_endpoint on, the segment after an endpoint came out wrong on the
test file 0.wav:

  before: "давайя жду"   (start_time 0.6)
  after:  "давай я жду"  (start_time 4.8)

There were three things going on, all T-one only:

1. Reset() put the model back to its initial states in the middle of
   the audio. T-one needs some silence after the initial states (that's
   why we add left padding at the start of a stream), so the first
   words of the next segment were decoded badly. Feeding a fresh stream
   from the same point gives the exact same bad output, and adding 0.3s
   of padding fixes it. Now we keep the states for T-one and only clear
   the decoding result.

2. start_time used 30ms per frame, but GetNumFramesSinceStart() counts
   300ms input frames for T-one, so it was 10x too small.

3. IsEndpoint() had the same mix-up: num_processed_frames is in 300ms
   frames but was multiplied by 0.03s, so the utterance length was 10x
   too short. That made rule2 (must contain non-silence) never fire and
   rule3 would need ~200s instead of 20s.

Checked with a local build: the token timestamps in the second segment
now line up with the ones you get without endpointing. Other models are
not touched.
2026-11-05 17:29:12 +08:00
Anmol Guragain b20026d8fd Add streaming Paraformer example for the Rust API (#4155) 2026-11-05 17:27:15 +08:00
Zachary Alexander 67609c0529 Run the clang-tidy CI job on ubuntu-latest (#4158) 2026-11-05 13:40:32 +08:00
Anmol Guragain 8c092a193f Add a streaming T-one CTC example for the Rust API (#4156) 2026-11-04 09:14:49 +08:00
XDcobra 111617b114 Add C-API SetVoiceSample for VoxLock PCM enroll (#4151) 2026-11-03 21:15:48 +08:00
Fangjun Kuang 935e5ded3d Refactor CI for Python tests (#4136) 2026-10-29 20:00:57 +08:00
Fangjun Kuang 0767270e5a Reduce CI test runtime for the xcframework. (#4137) 2026-10-29 20:00:19 +08:00
Fangjun Kuang a7423b6cd5 Fix Python tests for Windows (#4135) 2026-10-29 15:01:37 +08:00
Fangjun Kuang f04a8f77f1 Refactor the parsing macro for node-addon. (#4134) 2026-10-29 13:55:40 +08:00
Fangjun Kuang 3c07bb1e9a Avoid removing spaces for Korean ASR results (#4132) 2026-10-29 13:42:10 +08:00
Fangjun Kuang 4161dacf2a Fix issues reported by clang-tidy and clang-format (#4130) 2026-10-29 10:30:18 +08:00
Fangjun Kuang 6897d04979 Refactor getting array element length for node-addon (#4129) 2026-10-29 10:23:26 +08:00
matiaslin 99dbc1cbd0 Expose QnnConfig in Java/Kotlin bindings for all QNN-capable models (#4126) 2026-10-29 10:22:11 +08:00
Julian Pscheid 01f24afb44 Keep online result tokens in sync when dropping leading punctuation (#4121) 2026-10-28 23:21:30 +08:00
Hugo Montenegro 1e528c8007 Pass --length-reward to the stream as given instead of via std::to_string (#4123)
std::to_string(float) keeps six decimals, so a tiny reward such as
1e-7 was forwarded as "0.000000". The decoder already parses and
validates the option, so the CLI now forwards the string unchanged.
2026-10-28 22:50:49 +08:00
Fangjun Kuang 5fc2ced341 Add multi-channel wave IO to the Node.js and HarmonyOS APIs (#4124) 2026-10-28 22:48:47 +08:00
Nexmoe 2f764d1db3 Add Node.js source separation APIs for Spleeter and UVR (#4122) 2026-10-28 16:18:02 +08:00
Arbaz Siddiqui bfbc6ec230 Support VoxLock 1.2 models in the speech denoisers (#4120) 2026-10-28 14:18:16 +08:00
matiaslin 2505cca5d7 Add an optional QNN HTP performance mode (#4117) 2026-10-28 09:41:55 +08:00
Daniil Sterkhov 8183d88b63 Support per-stream language candidates for Whisper (#4093) 2026-10-27 20:50:50 +08:00
Hugo MontenegroandHugo Montenegro 3898de1380 Fix modified_beam_search dropping speech for NeMo TDT models (#4084)
Hypotheses of a TDT model advance by their predicted durations, so the
beam holds hypotheses at different frames. They were ranked and pruned
together, although a hypothesis that is ahead has not yet paid for the
frames the others still have to consume. Hypotheses are now kept in
per-frame buckets and only compared within a bucket. Identical token
sequences are merged (log-add). For models without durations, expansion
on a frame stops, as in NeMo's beam search, once max_active_paths
hypotheses on later frames are better than the best one left on it.

Expansion follows NeMo's TDT beam search: blank is always expanded,
with each of the top-k non-zero durations, and non-blank tokens are
chosen as the top-k (token, duration) pairs instead of using only the
argmax duration.

The hotword boost used to select candidate tokens was also added to the
hypothesis score, on top of the context graph score, and was never taken
back when a hotword was not completed. It is now used for the selection
only.

Even with this search, the model gives paths that skip the onset of a
sentence after a pause and then emit blank with near certainty a higher
score than the correct path, so beam search drops whole sentences. Add
length_reward, a reward per emitted token, to counter it (default 0,
i.e. no reward).

Fixes #3267

* CI: smoke-test modified_beam_search with a NeMo TDT model

* Reject non-finite length_reward; keep expanding a frame when the length reward or hotwords can raise its hypotheses

* Pass length_reward per stream via SetOption instead of OfflineRecognizerConfig

Co-authored-by: Hugo Montenegro <hugofmsaiz@gmail.com>
2026-10-27 20:48:43 +08:00
Fangjun Kuang af2d8d81db Release v2.0.1 (#4115) v2.0.1 2026-10-26 22:57:12 +08:00
Fangjun Kuang 96255a1bb2 Add Pascal API for VoxLock (#4114) 2026-10-26 21:50:15 +08:00
Fangjun Kuang 7c5d107813 Add Rust API for VoxLock (#4112) 2026-10-26 21:49:34 +08:00
Fangjun Kuang 436c059fd3 Add Dart API for VoxLock (#4111) 2026-10-26 21:47:08 +08:00
Fangjun Kuang 52d85d3da1 Add Go API for VoxLock (#4110) 2026-10-26 21:36:46 +08:00
Fangjun Kuang 37ce81d5a0 Add Swift API for VoxLock (#4109) 2026-10-26 21:34:12 +08:00
Fangjun Kuang b17952620d Fix CI failures (#4113) 2026-10-26 21:27:40 +08:00
Fangjun Kuang 8b5ff1aa5e Add C# API for VoxLock (#4108) 2026-10-26 19:44:14 +08:00
Fangjun Kuang 687a26126c Add Java and Kotlin API for VoxLock (#4107) 2026-10-26 19:40:49 +08:00
Fangjun Kuang 42e1e0d077 Add JavaScript (WebAssembly) API for VoxLock (#4106) 2026-10-26 19:33:06 +08:00
Fangjun Kuang cb2071f22f Add JavaScript (node-addon) API for VoxLock (#4105) 2026-10-26 18:49:01 +08:00
Fangjun Kuang 1ec9807f1e Add C/CXX API for VoxLock (#4104) 2026-10-26 17:21:30 +08:00
Stef cc92083394 Keep the STFT convs of Kokoro in float32 when quantizing to int8 (#4087)
The Kokoro decoder's generator computes the phase of its forward STFT
with atan2(imag, real), which the exported graph implements as an
unguarded imag / real followed by Atan. imag and real are produced by
two Conv nodes. quantize_dynamic also quantized these two convs; at DC
and Nyquist the quantized imag is exactly 0, and with int8 arithmetic
real can become exactly 0 there as well, giving 0 / 0 = NaN.

On macOS arm64 the NaN spreads over the whole output, so short pieces of
text come back as all-NaN audio. On x64 the following
DynamicQuantizeLinear happens to drop the NaN, which hides the problem
but does not remove it.

Pass the two convs as nodes_to_exclude, for v1.0 and v1.1-zh. v0.19
computes the STFT without Conv nodes and is not affected.

The released int8 models kokoro-int8-multi-lang-v1_0 and
kokoro-int8-multi-lang-v1_1 need to be regenerated with this change.

Fixes #4086
2026-10-26 17:14:46 +08:00
Cassian433 da549ed597 Add OfflineRecognizer.createAsync() to the Dart API (#4070) 2026-10-26 17:13:01 +08:00
Hassan Kazi 49f4c887da Use librosa-style fbank for streaming NeMo CTC models (#4092) 2026-10-26 16:48:34 +08:00
Fangjun Kuang 5f97192eb9 Add Python API for VoxLock (#4102) 2026-10-26 16:31:50 +08:00
Fangjun Kuang 5a26343944 Upload VoxLock models and test data (#4101) 2026-10-26 12:27:43 +08:00
Manickavela 532f1b5a8a Add CLAUDE.md with build, test and architecture guidance (#4099) 2026-10-25 12:20:55 +08:00
Arbaz Siddiqui fa0d247a14 Add VoxLock target-speaker voice isolation to the speech denoisers (#4085)
VoxLock keeps the voice of one speaker (the caller) and removes the other
voices. It runs in the offline and online speech denoisers next to GTCRN
and DPDFNet, with two ONNX models: an enroll model that runs once on a
voice sample of the caller and a chunk model that runs on each chunk of
the audio and carries the LSTM state.

Without a voice sample, the offline denoiser uses the loudest 3 seconds
in the first 15 seconds of the input, and the online denoiser passes
audio through until it has heard 3 seconds of speech. A voice sample can
be given with --speech-denoiser-voxlock-voice-sample.

The voice sample is optional, so instead of exiting, log a warning and
take the voice sample from the input audio as if none was given.
2026-10-25 08:43:19 +08:00
Hassan Kazi c65f321699 Fix decoder positions of generated tokens in Canary greedy search (#4097)
The prompt is fed at positions 0..n-1, but generated tokens were fed at
1, 2, ... instead of n, n+1, ..., overlapping the prompt. Feed them at
decoder_input.size() + i - 1, as NeMo's GreedySequenceGenerator does.

Fixes #4096
2026-10-24 16:50:59 +08:00
Fangjun Kuang 88204440c2 Fix publishing flutter packages (#4091) 2026-10-23 23:48:11 +08:00
Fangjun Kuang 8abb7c8f87 Release v2.0.0 (#4090) v2.0.0 2026-10-23 20:32:33 +08:00
Fangjun Kuang bad60aa0b5 Fix Ascend CI (#4089) 2026-10-23 20:09:01 +08:00
Fangjun Kuang 12b4f4af2f Add tauri example for Doubao ASR (#4083) 2026-10-23 14:36:20 +08:00
DR1N0 36342561cb docs: add Loud Caption to projects using sherpa-onnx (#4074) 2026-10-22 23:44:45 +08:00
sunerpy 1cad51be77 Add Voltip to 'Projects using sherpa-onnx' (#4081) 2026-10-22 23:42:20 +08:00
Fangjun Kuang f2e01fe8e3 Widen VAD sample positions to int64_t to fix long-stream SIGSEGV. (#4079)
Fixes #3635

It is for v2.0.0 and breaks the ABI.

CircularBuffer::head_ and tail_ are absolute sample counters that grow
forever. As int32_t they overflow after 2^31 samples (~37 h at 16 kHz);
tail_ % capacity then goes negative and std::copy() writes to an invalid
iterator, crashing long-running VAD streams.

Widen every absolute stream position to int64_t. Counts and capacities
(Push/Pop/Get's n, Size(), capacity) stay int32_t — they are bounded by
buffer memory, not stream duration.
2026-10-22 23:39:59 +08:00
Fangjun Kuang 51ec64f7c4 Build wheels for Python 3.15gg (#4080) 2026-10-22 15:17:57 +08:00
Fangjun Kuang a9193276e4 Fix building Flutter APPs for macOS (#4078) 2026-10-22 13:44:57 +08:00