fix: stop TTS playback when PTT is activated
Pressing push-to-talk now immediately stops any ongoing TTS audio before opening the microphone, preventing the assistant from hearing itself. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,8 @@ const audio = useVoiceAudio()
|
||||
// ─── Core PTT flow ────────────────────────────────────────────────────────────
|
||||
async function startPtt() {
|
||||
if (!voiceEnabled.value || isBusy.value) return
|
||||
// Stop any in-progress TTS playback before opening the mic
|
||||
audio.stop()
|
||||
errorMsg.value = ''
|
||||
open.value = true
|
||||
await recorder.startRecording()
|
||||
|
||||
@@ -281,6 +281,7 @@ async function speakText(text: string) {
|
||||
// PTT: hold to record, release to transcribe and send
|
||||
async function startPtt() {
|
||||
if (!voiceEnabled.value || recorder.recording.value) return
|
||||
audio.stop()
|
||||
await recorder.startRecording()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user