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.