get rid of the stream parsing that occurs in the Layer III decoder. BitStream.readFra...
[IRC.git] / Robust / src / Tests / ssJava / mp3decoder / AudioDevice.java
1 // dummy audio device
2 /**
3  * The <code>JavaSoundAudioDevice</code> implements an audio device by using the
4  * JavaSound API.
5  * 
6  * @since 0.0.8
7  * @author Mat McGowan
8  */
9 public class AudioDevice {
10
11   /**
12    * Prepares the AudioDevice for playback of audio samples.
13    * 
14    * @param decoder
15    *          The decoder that will be providing the audio samples.
16    * 
17    *          If the audio device is already open, this method returns silently.
18    * 
19    */
20   public void open(Decoder decoder) throws JavaLayerException {
21
22   }
23
24   /**
25    * Retrieves the open state of this audio device.
26    * 
27    * @return <code>true</code> if this audio device is open and playing audio
28    *         samples, or <code>false</code> otherwise.
29    */
30   public boolean isOpen() {
31     return true;
32   }
33
34   /**
35    * Writes a number of samples to this <code>AudioDevice</code>.
36    * 
37    * @param samples
38    *          The array of signed 16-bit samples to write to the audio device.
39    * @param offs
40    *          The offset of the first sample.
41    * @param len
42    *          The number of samples to write.
43    * 
44    *          This method may return prior to the samples actually being played
45    *          by the audio device.
46    */
47   public void write(short[] samples, int offs, int len) throws JavaLayerException {
48
49   }
50
51   /**
52    * Closes this audio device. Any currently playing audio is stopped as soon as
53    * possible. Any previously written audio data that has not been heard is
54    * discarded.
55    * 
56    * The implementation should ensure that any threads currently blocking on the
57    * device (e.g. during a <code>write</code> or <code>flush</code> operation
58    * should be unblocked by this method.
59    */
60   public void close() {
61
62   }
63
64   /**
65    * Blocks until all audio samples previously written to this audio device have
66    * been heard.
67    */
68   public void flush() {
69
70   }
71
72   /**
73    * Retrieves the current playback position in milliseconds.
74    */
75   public int getPosition() {
76     return 0;
77   }
78
79 }