mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-11-10 21:11:03 +08:00
This pull request expands the Rust API examples by introducing a comprehensive set of simulated real-time ASR applications integrated with VAD. These additions allow users to interact with various ASR models directly through their microphone, providing a practical demonstration of the sherpa-onnx library's capabilities in a live audio processing context. The changes also include necessary infrastructure for audio resampling and improved output display.
25 lines
1.2 KiB
Bash
Executable File
25 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -ex
|
|
|
|
# https://k2-fsa.github.io/sherpa/onnx/vad/silero-vad.html
|
|
if [ ! -f "./silero_vad.onnx" ]; then
|
|
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx
|
|
fi
|
|
|
|
# see
|
|
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-transducer/nemo-transducer-models.html#sherpa-onnx-nemo-parakeet-tdt-0-6b-v2-int8-english
|
|
if [ ! -f ./sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8/encoder.int8.onnx ]; then
|
|
curl -SsL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8.tar.bz2
|
|
|
|
tar xvf sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8.tar.bz2
|
|
rm sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8.tar.bz2
|
|
ls -lh sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8
|
|
fi
|
|
|
|
cargo run --example parakeet_tdt_simulate_streaming_microphone --features mic -- \
|
|
--silero-vad-model ./silero_vad.onnx \
|
|
--encoder ./sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8/encoder.int8.onnx \
|
|
--decoder ./sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8/decoder.int8.onnx \
|
|
--joiner ./sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8/joiner.int8.onnx \
|
|
--tokens ./sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8/tokens.txt
|