Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
remove the wavfile parsing for clients
雾聪d3c969056866
diff --git a/runtime/python/websocket/funasr_wss_client.py b/runtime/python/websocket/funasr_wss_client.pyindex e469319c9..92dc548c3 100644--- a/runtime/python/websocket/funasr_wss_client.py+++ b/runtime/python/websocket/funasr_wss_client.py@@ -186,13 +186,6 @@ async def record_from_scp(chunk_begin, chunk_size):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:diff --git a/runtime/websocket/bin/funasr-wss-client-2pass.cpp b/runtime/websocket/bin/funasr-wss-client-2pass.cppindex 2db66ff36..6533dd556 100644--- a/runtime/websocket/bin/funasr-wss-client-2pass.cpp+++ b/runtime/websocket/bin/funasr-wss-client-2pass.cpp@@ -192,9 +192,7 @@ class WebsocketClient {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";diff --git a/runtime/websocket/bin/funasr-wss-client.cpp b/runtime/websocket/bin/funasr-wss-client.cppindex dddab8e63..93ff62b28 100644--- a/runtime/websocket/bin/funasr-wss-client.cpp+++ b/runtime/websocket/bin/funasr-wss-client.cpp@@ -189,10 +189,7 @@ class WebsocketClient {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{