Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

Commit 65ff401

Browse files
authored
Merge pull request #3 from gotracker/mixer-fixup
Mixer API cleanup
2 parents ef2973b + fe9de91 commit 65ff401

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

mixing/mixer.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import (
77

88
// Mixer is a manager for mixing multiple single- and multi-channel samples into a single multi-channel output stream
99
type Mixer struct {
10-
Channels int
11-
BitsPerSample int
10+
Channels int
1211
}
1312

1413
// NewMixBuffer returns a mixer buffer with a number of channels
@@ -42,8 +41,8 @@ func (m Mixer) Flatten(panmixer PanMixer, samplesLen int, row []ChannelData, mix
4241
}
4342

4443
// FlattenToInts runs a flatten on the channel data into separate channel data of int32 variety
45-
// these int32s still respect the BitsPerSample size
46-
func (m Mixer) FlattenToInts(panmixer PanMixer, samplesLen int, row []ChannelData, mixerVolume volume.Volume) [][]int32 {
44+
// these int32s still respect the bitsPerSample size
45+
func (m Mixer) FlattenToInts(panmixer PanMixer, samplesLen, bitsPerSample int, row []ChannelData, mixerVolume volume.Volume) [][]int32 {
4746
data := m.NewMixBuffer(samplesLen)
4847
for _, rdata := range row {
4948
for _, cdata := range rdata {
@@ -56,7 +55,7 @@ func (m Mixer) FlattenToInts(panmixer PanMixer, samplesLen int, row []ChannelDat
5655
}
5756
}
5857
}
59-
return data.ToIntStream(panmixer.NumChannels(), samplesLen, m.BitsPerSample, mixerVolume)
58+
return data.ToIntStream(panmixer.NumChannels(), samplesLen, bitsPerSample, mixerVolume)
6059
}
6160

6261
// FlattenTo will to a final saturation mix of all the row's channel data into a single output buffer

0 commit comments

Comments
 (0)