mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 10:29:45 +02:00
added comment
This commit is contained in:
@@ -10,8 +10,11 @@ import javax.sound.sampled.LineListener;
|
|||||||
|
|
||||||
public class AudioPlayer {
|
public class AudioPlayer {
|
||||||
|
|
||||||
public AudioPlayer(/** String file */) {
|
public AudioPlayer() {
|
||||||
///this.file = file;
|
/** oder anstelle pfad an die methode play,
|
||||||
|
* immer an die klasse und dann einen Player für jedes Soundfile
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void play(String file) {
|
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();
|
clip.start();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user