There is a Port that gives you access to a computer mixer, but a muffled sound mutes your computer. So this is probably not a very good option.
In addition, I believe that you need an instance of the Clip or SourceDataLine class that is currently playing. Most likely, however, the applet uses the Applet AudioClip class to play, which may or may not use Clip / SourceDataLine inside ...
In any case, you can try the following approach, it should work on most Java Sound implementations:
from AudioSystem, get all mixers
Mixer.Info[] infos = AudioSystem.getMixerInfo(); for (Mixer.Info info: infos) { Mixer mixer = AudioSystem.getMixer(info); }
be sure to import javax.sound.sampled. *
- from each mixer, extract the
getSourceLines() using getSourceLines() for each row returned, try getting a mute control:
BooleanControl bc = (BooleanControl) line.getControl(BooleanControl.Type.MUTE) if (bc != null) { bc.setValue(true); // true to mute the line, false to unmute }
Note that there is no guarantee that you will receive strings, and you cannot guarantee that the Java Sound implementation provides MUTE control for a given string.
source share