update:优化豆包流式ASR接口

This commit is contained in:
hrz
2025-06-04 16:43:15 +08:00
parent d06e297c2d
commit 03bcf5d2c7
7 changed files with 249 additions and 420 deletions
@@ -84,9 +84,13 @@ class ASRProviderBase(ABC):
text_len, _ = remove_punctuation_and_length(raw_text)
if text_len > 0:
# 使用自定义模块进行上报
self.stop_ws_connection()
await startToChat(conn, raw_text)
enqueue_asr_report(conn, raw_text, asr_audio_task)
def stop_ws_connection(self):
pass
def save_audio_to_file(self, pcm_data: List[bytes], session_id: str) -> str:
"""PCM数据保存为WAV文件"""
module_name = __name__.split(".")[-1]