Set volume of this example with Minim

Hi,

To set the volume, you can look at the setVolume() method for the AudioOutput class.

However I’ve tested myself on Processing 3.5.4 and it seems that this method is not supported :

So you can use the setGain() method in the mouseMoved() function that accepts decibels :

out.setGain(((float)mouseY / height) * 10);

However when printing the gain to the console, it stays limited at 6.0206 dB… Maybe someone have the solution :slight_smile:

(mouseY / height return a number between 0 and 1 and since you want to have a float division, you cast the first number before)

2 Likes