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 ────────────────────────────────────────────────────────────
|
// ─── Core PTT flow ────────────────────────────────────────────────────────────
|
||||||
async function startPtt() {
|
async function startPtt() {
|
||||||
if (!voiceEnabled.value || isBusy.value) return
|
if (!voiceEnabled.value || isBusy.value) return
|
||||||
|
// Stop any in-progress TTS playback before opening the mic
|
||||||
|
audio.stop()
|
||||||
errorMsg.value = ''
|
errorMsg.value = ''
|
||||||
open.value = true
|
open.value = true
|
||||||
await recorder.startRecording()
|
await recorder.startRecording()
|
||||||
|
|||||||
@@ -281,6 +281,7 @@ async function speakText(text: string) {
|
|||||||
// PTT: hold to record, release to transcribe and send
|
// PTT: hold to record, release to transcribe and send
|
||||||
async function startPtt() {
|
async function startPtt() {
|
||||||
if (!voiceEnabled.value || recorder.recording.value) return
|
if (!voiceEnabled.value || recorder.recording.value) return
|
||||||
|
audio.stop()
|
||||||
await recorder.startRecording()
|
await recorder.startRecording()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user