1

I use the RtAudio library.

I would like to implement an audio program where I can control the panning (e.g. shifting the sound from the left channel to the right channel).

In my specific case, I use RtAudio in duplex mode (you can find an example here: duplex mode). It means that I link the microphone input to the speaker output.

I have searched on the web, but I did not find anything useful. Should I apply a filter on the output buffer? What kind of filter?

  • "you can find an example here" - where? – gnat Nov 07 '12 at 14:43
  • you are right, now there is the link – user1801724 Nov 07 '12 at 14:56
  • Are you looking for an architecture/design answer? I may be wrong, but I think this would be a better fit for SO, since you're basically asking an implementation question. If you are in front of your IDE your question belongs on SO. If you are in front of a whiteboard your question belongs on Programmers. – Walter Dec 07 '12 at 16:38

1 Answers1

1

To pan a sound, you just have to reduce the volume in one channel while increasing it in the other. But you have to do it in such a way that the overall volume does not change, since a center pan will have two channels producing sound instead of one (full left or full right pan).

More info here: http://logicquicktips.blogspot.com/2006/10/laws-of-pan.html

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501