From c69dec04e0c49f26844fc72c5612083bdb970b79 Mon Sep 17 00:00:00 2001
From: Xin Wang
Date: Wed, 10 Jun 2026 15:26:33 +0800
Subject: [PATCH] Implement microphone selection feature in voice preview
- Add audio input selection to DebugVoicePanel, allowing users to choose their microphone device.
- Update useVoicePreview hook to manage available audio inputs and selected device state.
- Enhance device enumeration and selection handling to ensure a seamless user experience during voice interactions.
---
.../src/components/pages/AssistantPage.tsx | 30 ++++++++++
frontend/src/hooks/use-voice-preview.ts | 60 +++++++++++++++++--
2 files changed, 84 insertions(+), 6 deletions(-)
diff --git a/frontend/src/components/pages/AssistantPage.tsx b/frontend/src/components/pages/AssistantPage.tsx
index c5ab86f..40926b7 100644
--- a/frontend/src/components/pages/AssistantPage.tsx
+++ b/frontend/src/components/pages/AssistantPage.tsx
@@ -1857,6 +1857,9 @@ function DebugVoicePanel({
micWarning,
localStream,
messages,
+ audioInputs,
+ selectedDeviceId,
+ setSelectedDeviceId,
sendText,
connect,
disconnect,
@@ -1942,6 +1945,33 @@ function DebugVoicePanel({
+
+
+
+