Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epoxy
GitHub Repository: epoxy/proj11
Path: blob/master/SLICK_HOME/src/org/newdawn/slick/openal/AudioInputStream.java
1461 views
1
package org.newdawn.slick.openal;
2
3
import java.io.IOException;
4
5
/**
6
* The description of an input stream that supplied audio data suitable for
7
* use in OpenAL buffers
8
*
9
* @author kevin
10
*/
11
interface AudioInputStream {
12
/**
13
* Get the number of channels used by the audio
14
*
15
* @return The number of channels used by the audio
16
*/
17
public int getChannels();
18
19
/**
20
* The play back rate described in the underling audio file
21
*
22
* @return The playback rate
23
*/
24
public int getRate();
25
26
/**
27
* Read a single byte from the stream
28
*
29
* @return The single byte read
30
* @throws IOException Indicates a failure to read the underlying media
31
* @see java.io.InputStream#read()
32
*/
33
public int read() throws IOException;
34
35
/**
36
* Read up to data.length bytes from the stream
37
*
38
* @param data The array to read into
39
* @return The number of bytes read or -1 to indicate no more bytes are available
40
* @throws IOException Indicates a failure to read the underlying media
41
* @see java.io.InputStream#read(byte[])
42
*/
43
public int read(byte[] data) throws IOException;
44
45
/**
46
* Read up to len bytes from the stream
47
*
48
* @param data The array to read into
49
* @param ofs The offset into the array at which to start writing
50
* @param len The maximum number of bytes to read
51
* @return The number of bytes read or -1 to indicate no more bytes are available
52
* @throws IOException Indicates a failure to read the underlying media
53
* @see java.io.InputStream#read(byte[], int, int)
54
*/
55
public int read(byte[] data, int ofs, int len) throws IOException;
56
57
/**
58
* Check if the stream is at the end, i.e. end of file or URL
59
*
60
* @return True if the stream has no more data available
61
*/
62
public boolean atEnd();
63
64
/**
65
* Close the stream
66
*
67
* @see java.io.InputStream#close()
68
* @throws IOException Indicates a failure to access the resource
69
*/
70
public void close() throws IOException;
71
}
72
73