public class AudioSystem3D extends Object
Constructor and Description |
---|
AudioSystem3D() |
Modifier and Type | Method and Description |
---|---|
static Context |
createContext(Device device)
Creates a new Sound3D Context for a specified device.
|
static Buffer[] |
generateBuffers(int numBuffers)
Generate an array of Sound3D buffers.
|
static Source |
generateSource(Buffer buff)
Generate a Sound3D source from an initialized Buffer.
|
static Source[] |
generateSources(int numSources)
Generates a set of uninitialized Source3D sources
|
static Listener |
getListener()
Get the listener object associated with this Sound3D environment.
|
static void |
init()
Iniitalize the Sound3D environment.
|
static Buffer |
loadBuffer(InputStream stream)
Loads a Sound3D buffer with the specified audio file.
|
static Buffer |
loadBuffer(String filename)
Loads a Sound3D buffer with the specified audio file.
|
static Source |
loadSource(InputStream stream)
Loads a Sound3D Source with the specified audio stream.
|
static Source |
loadSource(String filename)
Loads a Sound3D Source with the specified audio file.
|
static void |
makeContextCurrent(Context context)
Makes the specified context the current context.
|
static Device |
openDevice(String deviceName)
Opens the specifified audio device.
|
public static void init() throws ALException
ALException
public static Context createContext(Device device)
device
- The device the Context is being created for.public static void makeContextCurrent(Context context)
context
- the context to make current.public static Device openDevice(String deviceName)
deviceName
- The specified device name, On windows this will be
DirectSound3D. We will be automating device discovery in upcoming versions
of this class.public static Buffer[] generateBuffers(int numBuffers)
numBuffers
- The number of Sound3D buffers to generate.public static Buffer loadBuffer(String filename) throws IOException, UnsupportedAudioFileException
filename
- the name of the file to load.IOException
- If the file cannot be found or some other IO error
occurs.UnsupportedAudioFileException
- If the format of the audio data is
not supportedpublic static Buffer loadBuffer(InputStream stream) throws IOException, UnsupportedAudioFileException
stream
- contains the stream associated with the audio file.IOException
- If the stream cannot be read or some other IO error
occurs.UnsupportedAudioFileException
- If the format of the audio data is
not supportedpublic static Source loadSource(String filename) throws IOException, UnsupportedAudioFileException
filename
- the name of the file to load.IOException
- If the file cannot be found or some other IO error
occurs.UnsupportedAudioFileException
- If the format of the audio data is
not supportedpublic static Source loadSource(InputStream stream) throws IOException, UnsupportedAudioFileException
stream
- contains the stream associated with the audio file.IOException
- If the file cannot be found or some other IO error
occurs.UnsupportedAudioFileException
- If the format of the audio data is
not supportedpublic static Source[] generateSources(int numSources)
numSources
- the number of Sound3D sources to generate.public static Source generateSource(Buffer buff)
buff
- The buffer to generate the source from.public static Listener getListener()