From b6d7ee848ae37513666a4ed01ee5ffcfc1a9b643 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 8 Apr 2024 11:58:32 -0600 Subject: [PATCH] Update logic --- cmd/client/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/client/main.go b/cmd/client/main.go index 34229a7..ba10f55 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -60,7 +60,7 @@ func main() { inDeviceConfig := malgo.DefaultDeviceConfig(malgo.Capture) inDeviceConfig.Capture.Format = capture_device.Formats[0].Format - inDeviceConfig.Capture.Channels = 1 + inDeviceConfig.Capture.Channels = capture_device.Formats[0].Channels inDeviceConfig.Capture.DeviceID = capture_device.ID.Pointer() inDeviceConfig.SampleRate = capture_device.Formats[0].SampleRate inDeviceConfig.PeriodSizeInFrames = 100 @@ -69,7 +69,7 @@ func main() { outDeviceConfig := malgo.DefaultDeviceConfig(malgo.Playback) outDeviceConfig.Playback.Format = playback_device.Formats[0].Format - outDeviceConfig.Playback.Channels = 1 + outDeviceConfig.Playback.Channels = playback_device.Formats[0].Channels outDeviceConfig.Playback.DeviceID = playback_device.ID.Pointer() outDeviceConfig.SampleRate = playback_device.Formats[0].SampleRate outDeviceConfig.PeriodSizeInFrames = 100 @@ -90,7 +90,7 @@ func main() { Data: onSendFrames, } - fmt.Printf("Creating playback device %+v\n", playback_device) + fmt.Printf("Creating playback device %+v with format %+v\n", playback_device, playback_device.Formats[0]) outDevice, err := malgo.InitDevice(ctx.Context, outDeviceConfig, playbackCallbacks) if err != nil { panic(err) @@ -119,7 +119,7 @@ func main() { Data: onRecvFrames, } - fmt.Printf("Creating capture device %+v\n", capture_device) + fmt.Printf("Creating capture device %+v with format %+v\n", capture_device, capture_device.Formats[0]) inDevice, err := malgo.InitDevice(ctx.Context, inDeviceConfig, captureCallbacks) if err != nil { panic(err)