How to set the volume in this simple example? I saw different approaches before but I don't know how to adapt them for my simple snippet.
Related Questions:
Code listing:
package view.sound;
import java.io.FileInputStream;
import javazoom.jl.player.Player;
public class Audio extends Thread {
String fileLocation = "src/EgyptianTavernFullofGuitarists_1.mp3";
boolean loop = true;
Player player;
@Override
public void run() {
try {
do {
FileInputStream buff = new FileInputStream(fileLocation);
player = new Player(buff);
player.play();
} while (loop);
} catch (Exception ioe) {
}
}
public void close(){
loop = false;
player.close();
this.interrupt();
}
}