I have searched the internet with relevant terms and haven't been able to come up with anything. I turned to this forum not because I deny the solution is somewhere on the internet, but because I thought some polite, helpful person could get me there more quickly. I really hope nobody actually believes that's an abuse of these forums.
Apparently my question was not clear enough. Here's my situation, reworded and more detailed:
I'm writing a small application that automates tasks using java.awt.Robot. I'd like to run a function whenever the sound from a separate application (as in, not written by me) reaches a certain volume. What would be ideal is some kind of Listener (which I haven't been able to find searching on Google) for system sound.
Here's a pseudocode example of what I'd like to do ("pseudo" stuff in brackets):
import java.awt.Robot;
import [SomeAudioClass];
public class MyClass
{
private Robot robot;
private [SomeAudioClass] someAudio;
public MyClass()
{
robot = new Robot();
someAudio.[addSoundListener](new [SoundListener()] {
public void [volumeChanged](int level)
{
if (level > 50)
{
robot.moveMouse(X, Y);
}
}
});
}
}
Does anyone know a way to do this?
Thanks for your help.