From 08a396571f87ee2888fc855964a5442f2a163879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BA=BA=E7=94=9F?= Date: Wed, 13 Apr 2022 13:01:30 +0800 Subject: [PATCH] fix : Turn on the microphone with the current device id (#395) * fix : Turn on the microphone with the current device id * modify comments --- pkg/driver/microphone/microphone.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/driver/microphone/microphone.go b/pkg/driver/microphone/microphone.go index 3b73a8b..8dcec4f 100644 --- a/pkg/driver/microphone/microphone.go +++ b/pkg/driver/microphone/microphone.go @@ -111,6 +111,8 @@ func (m *microphone) AudioRecord(inputProp prop.Media) (audio.Reader, error) { config.PerformanceProfile = malgo.LowLatency config.Capture.Channels = uint32(inputProp.ChannelCount) config.SampleRate = uint32(inputProp.SampleRate) + //FIX: Turn on the microphone with the current device id + config.Capture.DeviceID = m.ID.Pointer() if inputProp.SampleSize == 4 && inputProp.IsFloat { config.Capture.Format = malgo.FormatF32 } else if inputProp.SampleSize == 2 && !inputProp.IsFloat {