alsa: pass codec to ring buffer size calc

This commit is contained in:
Trek H 2020-12-24 09:57:32 +10:30
parent 3e30e4846b
commit 35e602748d
1 changed files with 1 additions and 1 deletions

View File

@ -170,7 +170,7 @@ func (d *ALSA) Setup(c config.Config) error {
} }
// Create ring buffer with appropriate chunk size. // 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) d.rb = ring.NewBuffer(rbLen, cs, rbTimeout)
// Start device in paused mode. // Start device in paused mode.