mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-09 21:31:51 +09:00
Former-commit-id: 1647fa32ef6894bd7db44f741f07c2f4dcdf9054 Former-commit-id: 0e5810dcfbe1fd59b13e7cabe9f1e93c5542da2d
72 lines
1.9 KiB
Java
72 lines
1.9 KiB
Java
package org.newdawn.slick.openal;
|
|
|
|
import java.io.IOException;
|
|
|
|
/**
|
|
* The description of an input stream that supplied audio data suitable for
|
|
* use in OpenAL buffers
|
|
*
|
|
* @author kevin
|
|
*/
|
|
interface AudioInputStream {
|
|
/**
|
|
* Get the number of channels used by the audio
|
|
*
|
|
* @return The number of channels used by the audio
|
|
*/
|
|
public int getChannels();
|
|
|
|
/**
|
|
* The play back rate described in the underling audio file
|
|
*
|
|
* @return The playback rate
|
|
*/
|
|
public int getRate();
|
|
|
|
/**
|
|
* Read a single byte from the stream
|
|
*
|
|
* @return The single byte read
|
|
* @throws IOException Indicates a failure to read the underlying media
|
|
* @see java.io.InputStream#read()
|
|
*/
|
|
public int read() throws IOException;
|
|
|
|
/**
|
|
* Read up to data.length bytes from the stream
|
|
*
|
|
* @param data The array to read into
|
|
* @return The number of bytes read or -1 to indicate no more bytes are available
|
|
* @throws IOException Indicates a failure to read the underlying media
|
|
* @see java.io.InputStream#read(byte[])
|
|
*/
|
|
public int read(byte[] data) throws IOException;
|
|
|
|
/**
|
|
* Read up to len bytes from the stream
|
|
*
|
|
* @param data The array to read into
|
|
* @param ofs The offset into the array at which to start writing
|
|
* @param len The maximum number of bytes to read
|
|
* @return The number of bytes read or -1 to indicate no more bytes are available
|
|
* @throws IOException Indicates a failure to read the underlying media
|
|
* @see java.io.InputStream#read(byte[], int, int)
|
|
*/
|
|
public int read(byte[] data, int ofs, int len) throws IOException;
|
|
|
|
/**
|
|
* Check if the stream is at the end, i.e. end of file or URL
|
|
*
|
|
* @return True if the stream has no more data available
|
|
*/
|
|
public boolean atEnd();
|
|
|
|
/**
|
|
* Close the stream
|
|
*
|
|
* @see java.io.InputStream#close()
|
|
* @throws IOException Indicates a failure to access the resource
|
|
*/
|
|
public void close() throws IOException;
|
|
}
|