From 629543142db90c1b3a22ac9deaee0e84a0d04aa5 Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Sun, 23 Jul 2017 23:37:53 +0100 Subject: [PATCH] README: clarify stereo vs mono in decoding api --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 40c3962..152737d 100644 --- a/README.md +++ b/README.md @@ -100,11 +100,11 @@ if err != nil { // To get all samples (interleaved if multiple channels): pcm = pcm[:n*channels] // only necessary if you didn't know the right frame size -// or access directly: +// or access sample per sample, directly: for i := 0; i < n; i++ { ch1 := pcm[i*channels+0] - // if stereo: - ch2 := pcm[i*channels+1] + // For stereo output: copy ch1 into ch2 in mono mode, or deinterleave stereo + ch2 := pcm[(i*channels)+(channels-1)] } ``` -- 2.48.1