Checkpoint
This commit is contained in:
125 files changed
+59376
No files matched your search
@@ -0,0 +1,15 @@
|
||||
package audio
|
||||
|
||||
// InterleavedStereoToMono converts interleaved stereo to mono samples.
|
||||
//
|
||||
// The size of src should be twice the size of dst. No bounds checking
|
||||
// is performed while writing to dst.
|
||||
func InterleavedStereoToMono(dst, src Slice) {
|
||||
var (
|
||||
i, j int
|
||||
l = src.Len() / 2
|
||||
)
|
||||
for ; i < l; i, j = i+1, j+2 {
|
||||
dst.Set(i, (src.At(j)+src.At(j+1))/2)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user