0

Suppose I've got a 16-bit PCM audio file. I wanna pan all of it completely to the left. How would I do this, purely through byte manipulation? Do I just mix the samples of the right channel with those of the left channel?

I'd also like to ask (since it seems related), how would I go about turning stereo samples into mono samples?

I'm doing this with Haxe, but code in something like C (or just an explanation of the method) should be sufficient. Thanks!

4

1 回答 1

1

您首先需要将原始字节转换为 int 数组。左声道的输出将是总和除以 2。

for (int i = 0 ; i < numFrames ; ++i)
{
   *pOutputL++ = (*pInputL++ + *pInputR++) >> 1;
   *pOutputR++ = 0;
}
于 2014-03-08T06:24:10.887 回答