changes: now Inference engine works fine with the EyeTracking benchmark.
[IRC.git] / Robust / src / Benchmarks / SSJava / MP3Decoder / MP3Player.java
1 // command line player for MPEG audio file
2 public class MP3Player {
3
4   private String filename = null;
5
6   public static void main(@DELEGATE String args[]) {
7
8     MP3Player player = new MP3Player();
9     player.init(args);
10
11   }
12
13   private void init(@DELEGATE String[] args) {
14     if (args.length == 1) {
15       filename = args[0];
16     }
17     play();
18   }
19
20   /**
21    * Playing file from FileInputStream.
22    */
23   // protected InputStream getInputStream() throws IOException {
24   // FileInputStream fin = new FileInputStream(filename);
25   // BufferedInputStream bin = new BufferedInputStream(fin);
26   // return bin;
27   // }
28
29   public void play() throws JavaLayerException {
30     try {
31       System.out.println("playing " + filename + "...");
32       BitstreamWrapper.init(filename);
33       AudioDevice dev = new AudioDevice();
34       Player player = new Player(dev);
35       player.play();
36     } catch (IOException ex) {
37       throw new JavaLayerException("Problem playing file " + filename, ex);
38     }
39   }
40
41 }