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.
Introduction
This folder contains C API examples for sherpa-onnx.
Please refer to the documentation https://k2-fsa.github.io/sherpa/onnx/c-api/index.html for details.
File descriptions
-
decode-file-c-api.c This file shows how to use the C API for speech recognition with a streaming model.
-
offline-tts-c-api.c This file shows how to use the C API to convert text to speech with a non-streaming model.
-
speech-enhancement-gtcrn-c-api.c This file shows how to use the C API for speech enhancement with GTCRN models.
-
speech-enhancement-dpdfnet-c-api.c This file shows how to use the C API for speech enhancement with DPDFNet models. Use 16 kHz DPDFNet models such as
dpdfnet_baseline.onnx,dpdfnet2.onnx,dpdfnet4.onnx, ordpdfnet8.onnxfor downstream ASR anddpdfnet2_48khz_hr.onnxfor 48 kHz enhancement output. -
online-speech-enhancement-gtcrn-c-api.c This file shows how to use the C API for online speech enhancement with GTCRN models.
-
online-speech-enhancement-dpdfnet-c-api.c This file shows how to use the C API for online speech enhancement with DPDFNet models. Use
dpdfnet_baseline.onnx,dpdfnet2.onnx,dpdfnet4.onnx, ordpdfnet8.onnxfor 16 kHz output.