From 1069991ff6f1b010b9a5e20f57aa04e6cdaf03d2 Mon Sep 17 00:00:00 2001 From: nokhnaton Date: Mon, 27 Jan 2025 17:36:55 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=87=E3=82=A3=E3=82=AA?= =?UTF-8?q?=E3=83=87=E3=83=90=E3=82=A4=E3=82=B9=E3=81=AE=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=82=92=E8=AA=8D=E8=AD=98=E3=81=97=E3=81=AA=E3=81=84=E3=82=82?= =?UTF-8?q?=E3=82=93=E3=81=A0=E3=81=84=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/qall/useLiveKitSDK.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/composables/qall/useLiveKitSDK.ts b/src/composables/qall/useLiveKitSDK.ts index 1a378bbd7..3662bfc23 100644 --- a/src/composables/qall/useLiveKitSDK.ts +++ b/src/composables/qall/useLiveKitSDK.ts @@ -261,8 +261,7 @@ async function leaveRoom() { const addMicTrack = async () => { let stream: MediaStream | undefined - const noiseSuppression = useRtcSettings().noiseSuppression - .value as NoiseSuppressionType + const { noiseSuppression, audioInputDeviceId } = useRtcSettings() try { if (!room.value?.localParticipant?.permissions?.canPublish) { throw new Error('権限がありません') @@ -272,12 +271,18 @@ const addMicTrack = async () => { audioContext.value = new AudioContext() } - stream = await navigator.mediaDevices.getUserMedia({ audio: true }) + stream = await navigator.mediaDevices.getUserMedia({ + audio: { + deviceId: { + ideal: audioInputDeviceId.value + } + } + }) const source = audioContext.value.createMediaStreamSource(stream) let lastNode: AudioNode = source - if (noiseSuppression === 'rnnoise') { + if (noiseSuppression.value === 'rnnoise') { const [rnnoiseBinary] = await Promise.all([ loadRnnoiseWasmBinary(), audioContext.value?.audioWorklet.addModule(rnnoiseWorkletPath) @@ -288,7 +293,7 @@ const addMicTrack = async () => { }) source.connect(rnnoiseNode) lastNode = rnnoiseNode - } else if (noiseSuppression === 'speex') { + } else if (noiseSuppression.value === 'speex') { const [speexBinary] = await Promise.all([ loadSpeexWasmBinary(), audioContext.value?.audioWorklet.addModule(speexWorkletPath)