我正在尝试更改程序的输出音频级别,最好以分贝为单位。我需要改变整个节目的音频电平并记录电平的变化。语言是Java。有什么简单的方法可以做到这一点?我用来播放声音的声音如下:
import java.io.InputStream;
import sun.audio.AudioPlayer;
import sun.audio.AudioStream;
public class Sound
{
String sounds;
public Sound(String file)
{
sounds = file;
playSound(sounds);
}//end contructor
public void playSound(String soundLoc)
{
try
{
InputStream inputStream = getClass().getResourceAsStream(soundLoc);
AudioStream audioStream = new AudioStream(inputStream);
AudioPlayer.player.start(audioStream);
}//end try
catch (Exception e)
{
}//end catch
}//end playSound method
}//end class Sound