STT 传输文件逻辑修改

This commit is contained in:
2025-10-16 23:08:33 +08:00
parent a5777d7beb
commit 161b74deed

View File

@@ -148,8 +148,9 @@ public class ChatWebSocketHandler {
try{ try{
//接收到数据流后直接就进行SST处理 //接收到数据流后直接就进行SST处理
//拿到文件进行文字转换 //拿到文件进行文字转换
saveAsWebM(bytes,pathUrl);
WhisperClient whisperClient = SpringUtils.getBean(WhisperClient.class); WhisperClient whisperClient = SpringUtils.getBean(WhisperClient.class);
String resultText = whisperClient.transcribeAudio(bytes,fileName); String resultText = whisperClient.handleVoiceToText(pathUrl);
//进行客户端文本数据存储 //进行客户端文本数据存储
String cacheString = cacheClientTts.get(clientId); String cacheString = cacheClientTts.get(clientId);
if(StrUtil.isNotEmpty(cacheString)){ if(StrUtil.isNotEmpty(cacheString)){