added comment

This commit is contained in:
timbo
2014-12-09 01:40:09 +01:00
parent 365e7ec792
commit f91d7f5a2f
+12 -3
View File
@@ -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) {