From cada3ea9094154f000dc16ed5f112c5373a4faad Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 8 Apr 2024 17:26:43 -0600 Subject: [PATCH] Change opus bitrate --- cmd/client/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/client/main.go b/cmd/client/main.go index e800ded..aa1bcfe 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -12,7 +12,7 @@ import ( func main() { decoders := map[pnyx.PeerID]*opus.Decoder{} - encoder, err := opus.NewEncoder(44100, 1, opus.AppVoIP) + encoder, err := opus.NewEncoder(48000, 1, opus.AppVoIP) if err != nil { panic(err) } @@ -69,8 +69,8 @@ func main() { inDeviceConfig.Capture.Format = malgo.FormatS16 inDeviceConfig.Capture.Channels = 1 inDeviceConfig.Capture.DeviceID = capture_device.ID.Pointer() - inDeviceConfig.SampleRate = 44100 - inDeviceConfig.PeriodSizeInFrames = 882 + inDeviceConfig.SampleRate = 48000 + inDeviceConfig.PeriodSizeInFrames = 960 inDeviceConfig.Alsa.NoMMap = 1 inDeviceConfig.Capture.ShareMode = malgo.Shared @@ -78,8 +78,8 @@ func main() { outDeviceConfig.Playback.Format = malgo.FormatS16 outDeviceConfig.Playback.Channels = 1 outDeviceConfig.Playback.DeviceID = playback_device.ID.Pointer() - outDeviceConfig.SampleRate = 44100 - outDeviceConfig.PeriodSizeInFrames = 882 + outDeviceConfig.SampleRate = 48000 + outDeviceConfig.PeriodSizeInFrames = 960 outDeviceConfig.Alsa.NoMMap = 1 outDeviceConfig.Playback.ShareMode = malgo.Shared @@ -181,7 +181,7 @@ func main() { if packet.Channel == pnyx.ChannelID(1) { decoder, exists := decoders[peer] if exists == false { - decoder, err = opus.NewDecoder(44100, 1) + decoder, err = opus.NewDecoder(48000, 1) if err != nil { panic(err) }