liumaolin
commited on
Commit
·
c3e85a2
1
Parent(s):
b5b48f0
Remove commented-out performance logging code from TTS player
Browse files
src/voice_dialogue/services/audio/player.py
CHANGED
|
@@ -69,13 +69,23 @@ class AudioStreamPlayer(BaseThread):
|
|
| 69 |
answer=voice_task.answer_sentence,
|
| 70 |
)
|
| 71 |
)
|
| 72 |
-
|
| 73 |
-
#
|
| 74 |
-
#
|
| 75 |
-
#
|
| 76 |
-
#
|
| 77 |
-
#
|
| 78 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
# )
|
| 80 |
|
| 81 |
self.update_chat_history(voice_task)
|
|
|
|
| 69 |
answer=voice_task.answer_sentence,
|
| 70 |
)
|
| 71 |
)
|
| 72 |
+
|
| 73 |
+
# import librosa
|
| 74 |
+
# asr_duration = voice_task.whisper_end_time - voice_task.whisper_start_time
|
| 75 |
+
# llm_duration = voice_task.llm_end_time - voice_task.llm_start_time
|
| 76 |
+
# tts_duration = voice_task.tts_end_time - voice_task.tts_start_time
|
| 77 |
+
# audio_data, sample_rate = voice_task.tts_generated_sentence_audio
|
| 78 |
+
# audio_duration = librosa.get_duration(y=audio_data, sr=sample_rate)
|
| 79 |
+
#
|
| 80 |
+
# logger.info(
|
| 81 |
+
# f"\n┌───────────────── 性能统计 (任务ID: {voice_task.id}) ─────────────────┐\n"
|
| 82 |
+
# f"│ ASR 耗时: {asr_duration:.2f}s\n"
|
| 83 |
+
# f"│ LLM 耗时: {llm_duration:.2f}s\n"
|
| 84 |
+
# f"│ TTS 耗时: {tts_duration:.2f}s\n"
|
| 85 |
+
# f"│ 音频长度: {audio_duration:.2f}s\n"
|
| 86 |
+
# f"├───────────────────────── 生成内容 ────────────────────────┤\n"
|
| 87 |
+
# f"│-> {voice_task.answer_sentence}\n"
|
| 88 |
+
# f"└──────────────────────────────────────────────────────────┘"
|
| 89 |
# )
|
| 90 |
|
| 91 |
self.update_chat_history(voice_task)
|