雾聪
2023-12-19 d3c96905686604aecac5df92f543786174b840f8
remove the wavfile parsing for clients
3个文件已修改
16 ■■■■ 已修改文件
runtime/python/websocket/funasr_wss_client.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/websocket/bin/funasr-wss-client-2pass.cpp 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/websocket/bin/funasr-wss-client.cpp 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
runtime/python/websocket/funasr_wss_client.py
@@ -186,13 +186,6 @@
        if wav_path.endswith(".pcm"):
            with open(wav_path, "rb") as f:
                audio_bytes = f.read()
        elif wav_path.endswith(".wav"):
            import wave
            with wave.open(wav_path, "rb") as wav_file:
                params = wav_file.getparams()
                sample_rate = wav_file.getframerate()
                frames = wav_file.readframes(wav_file.getnframes())
                audio_bytes = bytes(frames)
        else:
            wav_format = "others"
            with open(wav_path, "rb") as f:
runtime/websocket/bin/funasr-wss-client-2pass.cpp
@@ -192,9 +192,7 @@
    funasr::Audio audio(1);
    int32_t sampling_rate = audio_fs;
    std::string wav_format = "pcm";
    if (funasr::IsTargetFile(wav_path.c_str(), "wav")) {
      if (!audio.LoadWav(wav_path.c_str(), &sampling_rate, false)) return;
    } else if (funasr::IsTargetFile(wav_path.c_str(), "pcm")) {
    if (funasr::IsTargetFile(wav_path.c_str(), "pcm")) {
      if (!audio.LoadPcmwav(wav_path.c_str(), &sampling_rate, false)) return;
    } else {
      wav_format = "others";
runtime/websocket/bin/funasr-wss-client.cpp
@@ -189,10 +189,7 @@
        funasr::Audio audio(1);
        int32_t sampling_rate = audio_fs;
        std::string wav_format = "pcm";
        if(funasr::IsTargetFile(wav_path.c_str(), "wav")){
            if(!audio.LoadWav(wav_path.c_str(), &sampling_rate, false))
                return ;
        }else if(funasr::IsTargetFile(wav_path.c_str(), "pcm")){
        if(funasr::IsTargetFile(wav_path.c_str(), "pcm")){
            if (!audio.LoadPcmwav(wav_path.c_str(), &sampling_rate, false))
                return ;
        }else{