Просмотр исходного кода

fix(tts): keep audio int16, fix indentation

wenhongquan 3 недель назад
Родитель
Сommit
c80cfcdb22
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      asr_agent/conversation_worker.py

+ 1 - 1
asr_agent/conversation_worker.py

@@ -282,7 +282,7 @@ async def _tts_stream(text: str, voice: str = "Chloe"):
                         if audio and isinstance(audio, dict) and "data" in audio:
                         if audio and isinstance(audio, dict) and "data" in audio:
                             pcm = np.frombuffer(
                             pcm = np.frombuffer(
                                 base64.b64decode(audio["data"]), dtype=np.int16
                                 base64.b64decode(audio["data"]), dtype=np.int16
-                            ).astype(np.float32) / 32768.0
+                            )
                             if len(pcm) > 0:
                             if len(pcm) > 0:
                                 yield pcm, 24000, False
                                 yield pcm, 24000, False
                     except Exception:
                     except Exception: