mook
YaBB Newbies
Offline
Posts: 2
minim volume control problem **help!!**
Jul 28th , 2009, 12:17am
I'm in emergency, please help me with this. I'm using just following sample code: import ddf.minim.*; import ddf.minim.signals.*; Minim minim; AudioOutput out; //WaveformRenderer waveform; SawWave saw; void setup() { size(512, 200); minim = new Minim(this); out = minim.getLineOut(); //waveform = new WaveformRenderer(); // see the example Recordable >> addListener for more about this //out.addListener(waveform); // see the example AudioOutput >> SawWaveSignal for more about this saw = new SawWave(100, 0.2, out.sampleRate()); // see the example Polyphonic >> addSignal for more about this out.addSignal(saw); textFont(createFont("Arial", 12)); } void draw() { background(0); // see waveform.pde for more about this //waveform.draw(); if ( out.hasControl(Controller.PAN) ) { text("The current pan value is " + out.getPan() + ".", 5, 15); } else { text("The output doesn't have a pan control.", 5, 15); } if ( out.hasControl(Controller.VOLUME) ) { text("The current volume value is " + out.getVolume() + ".", 5, 30); } else { text("The output doesn't have a volume control.", 5, 30); } if ( out.hasControl(Controller.BALANCE) ) { text("The current balance value is " + out.getBalance() + ".", 5, 45); } else { text("The output doesn't have a balance control.", 5, 45); } if ( out.hasControl(Controller.GAIN) ) { text("The current gain value is " + out.getGain() + ".", 5, 60); } else { text("The output doesn't have a gain control.", 5, 60); } } void keyReleased() { if ( key == 'v' ) out.shiftVolume(0, 1, 2000); if ( key == 'g' ) out.shiftGain(-40, 0, 2000); if ( key == 'b' ) out.shiftBalance(-1, 1, 2000); if ( key == 'p' ) out.shiftPan(1, -1, 2000); } void stop() { // always close Minim audio classes when you are finished with them out.close(); minim.stop(); super.stop(); } and the result on the screen is: The current pan value is 0.0. The output doesn't have a volume control. The current balance value is 0.0. The current gain value is 0.0. It says this program doesn't have a volume control. and I have the same problems on other computers. I just need to get a volume control, but I just cannot find the way to do it. How can I get a volume control?!!!!!!! PLEASE HELP ME!!!!!PLEASE!!!!!!!! Im about to cry