雾聪
2023-12-13 51f7b76660fdb319c609138d4f922f3bdbc397f7
adapted pcm to 8k online
3个文件已修改
17 ■■■■ 已修改文件
runtime/onnxruntime/bin/funasr-onnx-online-asr.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/onnxruntime/bin/funasr-onnx-online-rtf.cpp 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/onnxruntime/bin/funasr-onnx-online-vad.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/onnxruntime/bin/funasr-onnx-online-asr.cpp
@@ -112,7 +112,7 @@
        auto& wav_file = wav_list[i];
        auto& wav_id = wav_ids[i];
        int32_t sampling_rate_ = -1;
        int32_t sampling_rate_ = audio_fs.getValue();
        funasr::Audio audio(1);
        if(is_target_file(wav_file.c_str(), "wav")){
            if(!audio.LoadWav2Char(wav_file.c_str(), &sampling_rate_)){
@@ -145,7 +145,7 @@
                    is_final = false;
            }
            gettimeofday(&start, NULL);
            FUNASR_RESULT result = FunASRInferBuffer(online_handle, speech_buff+sample_offset, step, RASR_NONE, NULL, is_final, audio_fs.getValue());
            FUNASR_RESULT result = FunASRInferBuffer(online_handle, speech_buff+sample_offset, step, RASR_NONE, NULL, is_final, sampling_rate_);
            gettimeofday(&end, NULL);
            seconds = (end.tv_sec - start.tv_sec);
            taking_micros += ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
runtime/onnxruntime/bin/funasr-onnx-online-rtf.cpp
@@ -52,7 +52,7 @@
    // warm up
    for (size_t i = 0; i < 10; i++)
    {
        int32_t sampling_rate_ = -1;
        int32_t sampling_rate_ = audio_fs;
        funasr::Audio audio(1);
        if(is_target_file(wav_list[0].c_str(), "wav")){
            if(!audio.LoadWav2Char(wav_list[0].c_str(), &sampling_rate_)){
@@ -84,7 +84,7 @@
                } else {
                    is_final = false;
            }
            FUNASR_RESULT result = FunASRInferBuffer(online_handle, speech_buff+sample_offset, step, RASR_NONE, NULL, is_final, audio_fs);
            FUNASR_RESULT result = FunASRInferBuffer(online_handle, speech_buff+sample_offset, step, RASR_NONE, NULL, is_final, sampling_rate_);
            if (result)
            {
                FunASRFreeResult(result);
@@ -98,7 +98,7 @@
        if (i >= wav_list.size()) {
            break;
        }
        int32_t sampling_rate_ = -1;
        int32_t sampling_rate_ = audio_fs;
        funasr::Audio audio(1);
        if(is_target_file(wav_list[i].c_str(), "wav")){
            if(!audio.LoadWav2Char(wav_list[i].c_str(), &sampling_rate_)){
@@ -131,7 +131,7 @@
                    is_final = false;
            }
            gettimeofday(&start, NULL);
            FUNASR_RESULT result = FunASRInferBuffer(online_handle, speech_buff+sample_offset, step, RASR_NONE, NULL, is_final, audio_fs);
            FUNASR_RESULT result = FunASRInferBuffer(online_handle, speech_buff+sample_offset, step, RASR_NONE, NULL, is_final, sampling_rate_);
            gettimeofday(&end, NULL);
            seconds = (end.tv_sec - start.tv_sec);
            long taking_micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
runtime/onnxruntime/bin/funasr-onnx-online-vad.cpp
@@ -141,10 +141,9 @@
        auto& wav_file = wav_list[i];
        auto& wav_id = wav_ids[i];
        int32_t sampling_rate_ = -1;
        int32_t sampling_rate_ = audio_fs.getValue();
        funasr::Audio audio(1);
        if(is_target_file(wav_file.c_str(), "wav")){
            int32_t sampling_rate_ = -1;
            if(!audio.LoadWav2Char(wav_file.c_str(), &sampling_rate_)){
                LOG(ERROR)<<"Failed to load "<< wav_file;
                exit(-1);
@@ -172,7 +171,7 @@
                    is_final = false;
            }
            gettimeofday(&start, NULL);
            FUNASR_RESULT result = FsmnVadInferBuffer(online_hanlde, speech_buff+sample_offset, step, NULL, is_final, audio_fs.getValue());
            FUNASR_RESULT result = FsmnVadInferBuffer(online_hanlde, speech_buff+sample_offset, step, NULL, is_final, sampling_rate_);
            gettimeofday(&end, NULL);
            seconds = (end.tv_sec - start.tv_sec);
            taking_micros += ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);