My current project involves playing music, and I found a useful working code to play .wav sound files, but how can I speed the sound up, raise or lower the volume, and mute the sound. Is there commands or methods I have to use? Here is what I'm currently using.
import java.io.*;
import javax.sound.sampled.*;
try {
AudioInputStream stream;
AudioFormat format;
DataLine.Info info;
Clip clip;
File file1 = new File("C:\\Users\\Bryce\\Desktop\\DM Galaxy.wav");
stream = AudioSystem.getAudioInputStream(file1);
format = stream.getFormat();
info = new DataLine.Info(Clip.class, format);
clip = (Clip) AudioSystem.getLine(info);
clip.open(stream);
clip.start();
} catch (Exception e) {
e.printStackTrace();
}
This works great, but the only problem is, it plays it at full blast, and sounds very slow comapaired to if I just play the audio file. Any sugestions?