This sketch demonstrates how to use the getBalance and setBalance methods of a
Controller object. The class used here is an AudioOutput but you can also
get and set the balance of AudioSample, AudioSnippet, AudioInput,
and AudioPlayer objects. getBalance and setBalance will get and set
the balance of the DataLine that is being used for input or output, but only if that line has
a balance control. A DataLine is a low-level JavaSound class that is used for sending audio to,
or receiving audio from, the audio system. You will notice in this sketch that you will hear the balance
changing (if it's available) but you will not see any difference in the waveform being drawn. The reason for this
is that what you see in the output's sample buffers is what it sends to the audio system. The system makes the
balance change after receiving the samples.
Source code: getSetBalance waveform
Built with Processing