add source code that does not have location annotations.
[IRC.git] / Robust / src / Benchmarks / SSJava / MP3DecoderInfer / MP3Player.java
diff --git a/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/MP3Player.java b/Robust/src/Benchmarks/SSJava/MP3DecoderInfer/MP3Player.java
new file mode 100644 (file)
index 0000000..7c18241
--- /dev/null
@@ -0,0 +1,41 @@
+// command line player for MPEG audio file
+public class MP3Player {
+
+  private String filename = null;
+
+  public static void main(@DELEGATE String args[]) {
+
+    MP3Player player = new MP3Player();
+    player.init(args);
+
+  }
+
+  private void init(@DELEGATE String[] args) {
+    if (args.length == 1) {
+      filename = args[0];
+    }
+    play();
+  }
+
+  /**
+   * Playing file from FileInputStream.
+   */
+  // protected InputStream getInputStream() throws IOException {
+  // FileInputStream fin = new FileInputStream(filename);
+  // BufferedInputStream bin = new BufferedInputStream(fin);
+  // return bin;
+  // }
+
+  public void play() throws JavaLayerException {
+    try {
+      System.out.println("playing " + filename + "...");
+      BitstreamWrapper.init(filename);
+      AudioDevice dev = new AudioDevice();
+      Player player = new Player(dev);
+      player.play();
+    } catch (IOException ex) {
+      throw new JavaLayerException("Problem playing file " + filename, ex);
+    }
+  }
+
+}
\ No newline at end of file