mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 07:39:45 +02:00
added comment
This commit is contained in:
@@ -10,8 +10,11 @@ import javax.sound.sampled.LineListener;
|
||||
|
||||
public class AudioPlayer {
|
||||
|
||||
public AudioPlayer(/** String file */) {
|
||||
///this.file = file;
|
||||
public AudioPlayer() {
|
||||
/** oder anstelle pfad an die methode play,
|
||||
* immer an die klasse und dann einen Player für jedes Soundfile
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
public void play(String file) {
|
||||
@@ -27,7 +30,13 @@ public class AudioPlayer {
|
||||
}
|
||||
});
|
||||
|
||||
clip.open(AudioSystem.getAudioInputStream(new File(file)));
|
||||
File f = new File(file);
|
||||
if(!f.exists()) {
|
||||
System.out.println("File not found: " + f.getAbsolutePath());
|
||||
return;
|
||||
}
|
||||
|
||||
clip.open(AudioSystem.getAudioInputStream(f));
|
||||
clip.start();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user