fix: 음성통화 TTS 괄호 문자 처리 + error 응답 시 큐 멈춤 버그 수정
OmniVoice가 "(" 문자(특히 한글에 바로 붙은 경우, 예: 영웅(Heroic))를 합성하다
멈춰버리는 문제가 있어 sanitizeForSpeech에서 괄호를 제거하도록 변경.
또한 TTS 엔진이 합성 실패 시 보내는 error 메시지를 클라이언트가 로그만 찍고
ttsBusy를 리셋하지 않아, 이후 통화 내내 TTS가 먹통이 되는 버그를 tts_end와
동일하게 큐를 복구하도록 수정.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -239,6 +239,18 @@
|
|||||||
|
|
||||||
case 'error':
|
case 'error':
|
||||||
console.warn('[voice-call] engine error:', msg.message);
|
console.warn('[voice-call] engine error:', msg.message);
|
||||||
|
// The failed request may have been the one holding ttsBusy — without
|
||||||
|
// resetting it here, pumpTtsQueue() early-returns forever and the
|
||||||
|
// call goes silent for the rest of the session.
|
||||||
|
if (!msg.id || msg.id === currentTtsId) {
|
||||||
|
ttsBusy = false;
|
||||||
|
currentTtsId = null;
|
||||||
|
pumpTtsQueue();
|
||||||
|
if (ttsQueue.length === 0) {
|
||||||
|
state = 'listening';
|
||||||
|
setStatus('듣는 중…');
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -269,6 +281,10 @@
|
|||||||
// remaining table rows: "| a | b |" -> "a, b" so cells read as a list
|
// remaining table rows: "| a | b |" -> "a, b" so cells read as a list
|
||||||
.replace(/^\s*\|(.+)\|\s*$/gm, (_m, row) => row.split('|').map((c) => c.trim()).filter(Boolean).join(', '))
|
.replace(/^\s*\|(.+)\|\s*$/gm, (_m, row) => row.split('|').map((c) => c.trim()).filter(Boolean).join(', '))
|
||||||
.replace(/https?:\/\/\S+/g, ' ')
|
.replace(/https?:\/\/\S+/g, ' ')
|
||||||
|
// OmniVoice chokes on a bare "(" — especially Hangul-adjacent, e.g.
|
||||||
|
// "영웅(Heroic)" — and stops generating audio entirely instead of just
|
||||||
|
// mispronouncing it. Drop the parens but keep their contents.
|
||||||
|
.replace(/[()()]/g, ' ')
|
||||||
.replace(/^\s{0,3}#{1,6}\s+/gm, '')
|
.replace(/^\s{0,3}#{1,6}\s+/gm, '')
|
||||||
.replace(/^\s*[-*+]\s+/gm, '')
|
.replace(/^\s*[-*+]\s+/gm, '')
|
||||||
.replace(/^\s*>\s?/gm, '')
|
.replace(/^\s*>\s?/gm, '')
|
||||||
|
|||||||
Reference in New Issue
Block a user