From 35e602748d5018e230092ba1300926c25c1a1809 Mon Sep 17 00:00:00 2001 From: Trek H Date: Thu, 24 Dec 2020 09:57:32 +1030 Subject: [PATCH] alsa: pass codec to ring buffer size calc --- device/alsa/alsa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/alsa/alsa.go b/device/alsa/alsa.go index b17a5031..fddbce82 100644 --- a/device/alsa/alsa.go +++ b/device/alsa/alsa.go @@ -170,7 +170,7 @@ func (d *ALSA) Setup(c config.Config) error { } // Create ring buffer with appropriate chunk size. - cs := pcm.DataSize(d.SampleRate, d.Channels, d.BitDepth, d.RecPeriod, 0) + cs := pcm.DataSize(d.SampleRate, d.Channels, d.BitDepth, d.RecPeriod, d.Codec) d.rb = ring.NewBuffer(rbLen, cs, rbTimeout) // Start device in paused mode.