# Set volume of this example with Minim

**URL:** <https://discourse.processing.org/t/set-volume-of-this-example-with-minim/21628>\
**Category:** Libraries\
**Created:** [June 6, 2020, 5:49pm UTC](https://discourse.processing.org/t/set-volume-of-this-example-with-minim/21628 "2020-06-06T17:49:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [June 7, 2020, 8:41am UTC](https://discourse.processing.org/t/set-volume-of-this-example-with-minim/21628/2 "2020-06-07T08:41:31Z")

</div>

Hi,

To set the volume, you can look at the [`setVolume()`](http://code.compartmental.net/minim/audiooutput_method_setvolume.html) method for the `AudioOutput` class.

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

- [Minim setting volume of an audioPlayer](https://discourse.processing.org/t/minim-setting-volume-of-an-audioplayer/3596/5)

So you can use the [`setGain()`](http://code.compartmental.net/minim/audiooutput_method_setgain.html) method in the `mouseMoved()` function that accepts decibels :

```auto
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 🙂

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

---

_[View the full topic](https://discourse.processing.org/t/set-volume-of-this-example-with-minim/21628)._
