Set volume of Java Clip
<p>Is there any way to set the respective volume of a <code>Clip</code> in <code>Java</code>?</p>

<p>I have this method:</p>

<pre><code>public static void play(Clip clip) {
    if (Settings.getSettings().isVolumeOn()) {
        FloatControl volume = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);
        volume.setValue(-1 * Settings.getSettings().getVolume());
        clip.start();
    }
}
</code></pre>

<p>The <code>Settings.getSettings().getVolume()</code> returns an <code>Integer</code> in the range of <code>0 - 100</code></p>

<blockquote>
  <p>Volumes:</p>
  
  <ol>
  <li>0  : No Sound</li>
  <li>40 : Optimal Sound with headphones</li>
  <li>60 : Optimal Sound</li>
  <li>100: Full Sound</li>
  </ol>
</blockquote>

<p>So essentially this should be like the scale of <code>VLC</code> (but half since VLC is from <code>0 to 200</code>).</p>

<p>I've found that I can reduce the decibel of the clip by using <code>volume.setValue(-10f);</code></p>

<p>But I would prefer something of the type <code>volume.setValue(clip.getMaxVolume() * Settings.getSettings().getVolume()/100)</code>.</p>

<p>Where <code>clip.getMaxVolume()</code> would return the max volume of the clip.</p>