I want to control PC stereo volume control, the following code is doing the same but both the channels are taking the save volume gain.
Q: How do I change the volume of individual channels?
Processing Code:
import processing.sound.*;
SoundFile file;
Sound s;
float val = 0.0;
float phase = 1.0;
void setup() {
size(640, 360);
background(0);
// Load a soundfile from the /data folder of the sketch and play it back
file = new SoundFile(this, "song.mp3");
file.play();
s = new Sound(this);
}
void draw() {
s.volume(val);
val = val + (phase*0.001);
if (val > 1.0){
phase = -1.0;
}
else if (val < 0.0){
phase = 1.0;
}
delay(1);
}