雾聪
2024-01-15 2e41e8db8e9c5179a19bbcd6f0514c27d5a270ea
runtime/onnxruntime/bin/funasr-onnx-online-vad.cpp
@@ -89,7 +89,7 @@
    GetValue(wav_path, WAV_PATH, model_path);
    struct timeval start, end;
    gettimeofday(&start, NULL);
    gettimeofday(&start, nullptr);
    int thread_num = 1;
    FUNASR_HANDLE vad_hanlde=FsmnVadInit(model_path, thread_num);
@@ -99,7 +99,7 @@
        exit(-1);
    }
    gettimeofday(&end, NULL);
    gettimeofday(&end, nullptr);
    long seconds = (end.tv_sec - start.tv_sec);
    long modle_init_micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
    LOG(INFO) << "Model initialization takes " << (double)modle_init_micros / 1000000 << " s";
@@ -170,9 +170,9 @@
                } else {
                    is_final = false;
            }
            gettimeofday(&start, NULL);
            FUNASR_RESULT result = FsmnVadInferBuffer(online_hanlde, speech_buff+sample_offset, step, NULL, is_final, sampling_rate_);
            gettimeofday(&end, NULL);
            gettimeofday(&start, nullptr);
            FUNASR_RESULT result = FsmnVadInferBuffer(online_hanlde, speech_buff+sample_offset, step, nullptr, is_final, sampling_rate_);
            gettimeofday(&end, nullptr);
            seconds = (end.tv_sec - start.tv_sec);
            taking_micros += ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);