Add C++ demo for VAD+non-streaming ASR (#1964)

This commit is contained in:
Fangjun Kuang
2025-03-07 11:49:46 +08:00
committed by GitHub
parent 1e2328242d
commit 362ddf2c07
6 changed files with 276 additions and 45 deletions

View File

@@ -131,10 +131,10 @@ for a list of pre-trained models to download.
std::vector<sherpa_onnx::OfflineStream *> ss_pointers;
float duration = 0;
for (int32_t i = 1; i <= po.NumArgs(); ++i) {
const std::string wav_filename = po.GetArg(i);
std::string wav_filename = po.GetArg(i);
int32_t sampling_rate = -1;
bool is_ok = false;
const std::vector<float> samples =
std::vector<float> samples =
sherpa_onnx::ReadWave(wav_filename, &sampling_rate, &is_ok);
if (!is_ok) {
fprintf(stderr, "Failed to read '%s'\n", wav_filename.c_str());