Interface spatialAudio.Environment
All Packages Class Hierarchy This Package Previous Next Index
Interface spatialAudio.Environment
- public interface Environment
- extends Object
The Environment interface is the main interface for the spatial
audio node. It controls global characteristics of the environment,
including the handedness of its coordinate system, its CPU budget,
its speed of sound,
and its reverberation settings. In addition, it defines methods for
adding sound sources and listeners to the environment.
Use the static function SpatialAudio.createEnvironment() to create a new
environment.
For details on use of the spatialAudio package, including code samples,
refer to the spatialAudio Package User's Guide.
Copyright (C) 1996-1997 Intel Corp.
- See Also:
- SpatialAudio, SoundSource, Listener, RenderOptions
-
createCachedSoundSource(InputStream)
- Creates a new CachedSoundSource.
-
createCachedSoundSource(int, InputStream, int, Object, Component, Object)
- Creates a new CachedSoundSource.
-
createCachedSoundSource(int, String, int, Object, Component, Object)
- Creates a new CachedSoundSource.
-
createCachedSoundSource(int, URL, int, Object, Component, Object)
- Creates a new CachedSoundSource.
-
createCachedSoundSource(String)
- Creates a new CachedSoundSource.
-
createCachedSoundSource(URL)
- Creates a new CachedSoundSource.
-
createDirectListener()
- Creates a new DirectListener with a preferred audio
format of PCM_22K_16BIT_STEREO.
-
createDirectListener(int, Object)
- Creates a new DirectListener with the specified characteristics.
-
createDirectListener(WaveFormat, Object)
- Creates a new DirectListener with the specified characteristics.
-
createStreamingListener(int)
- Creates a new streaming listener with the default characteristics.
-
createStreamingListener(int, int, Object)
- Creates a new StreamingListener with the specified characteristics.
-
createStreamingListener(WaveFormat, int, Object)
- Creates a new StreamingListener with the specified characteristics.
-
createStreamingSoundSource(int)
- Creates a new StreamingSoundSource with the preferred format specified.
-
createStreamingSoundSource(int, int, int, Object)
- Creates a new StreamingSoundSource with the preferred format specified.
-
createStreamingSoundSource(int, int, WaveFormat, Object)
- Creates a new StreamingSoundSource with the preferred format specified.
-
getInfo()
- Retrieves the info value set by the application.
-
getModel()
- Retrieves the current characteristics of the sound
Environment.
-
getReverb()
- Retrieves the current reverberation characteristics
of the sound environment.
-
release()
- Indicates that the application has finished using this Environment, and
requests that any resources associated with the Environment
be freed.
-
setInfo(Object)
- Sets the info value for the Environment.
-
setModel(EnvironmentModel)
- Sets the current characteristics of the sound
Environment.
-
setReverb(int)
- Specifies the reverberation characteristics for
the Environment.
-
setReverb(ReverbModel)
- Specifies the reverberation characteristics for
the Environment.
getModel
public abstract EnvironmentModel getModel() throws SpatialAudioException
- Retrieves the current characteristics of the sound
Environment. The EnvironmentModel includes the coordinate system type
(either right or left handed) and the CPU budget for localization.
- Returns:
- An instance of the EnvironmentModel class containing the
new audio environment settings. A SpatialAudioException is thrown
if the call fails.
setModel
public abstract boolean setModel(EnvironmentModel env)
- Sets the current characteristics of the sound
Environment.
- Parameters:
- env - An instance of the EnvironmentModel class containing the
new audio environment settings.
- Returns:
- true if the call succeeded, or false if it failed.
createStreamingSoundSource
public abstract StreamingSoundSource createStreamingSoundSource(int format) throws SpatialAudioException
- Creates a new StreamingSoundSource with the preferred format specified.
- Parameters:
- format - A WaveFormat value indicating the preferred format.
- Returns:
- An instance of a StreamingSoundSource object. A SpatialAudioException is thrown
if the call fails.
createStreamingSoundSource
public abstract StreamingSoundSource createStreamingSoundSource(int flags,
int type,
int format,
Object info) throws SpatialAudioException
- Creates a new StreamingSoundSource with the preferred format specified.
- Parameters:
- flags - A RenderOptions value or values which specify rendering options for the sound source.
- type - Identifies the type of streaming data.
- format - A WaveFormat value indicating the preferred format.
- info - May be used to store application-specific information.
- Returns:
- An instance of a StreamingSoundSource object. A SpatialAudioException is thrown
if the call fails.
createStreamingSoundSource
public abstract StreamingSoundSource createStreamingSoundSource(int flags,
int type,
WaveFormat format,
Object info) throws SpatialAudioException
- Creates a new StreamingSoundSource with the preferred format specified.
- Parameters:
- flags - A RenderOptions value or values which specify rendering
options for the sound source.
- type - Identifies the type of streaming data.
This parameter is currently not used and should be zero.
- format - Specifies the format of the stream to be used for this sound source.
Currently, this format may be anything resolvable to PCM by installed ACM drivers.
- info - May be used to store application-specific information.
- Returns:
- An instance of a StreamingSoundSource object. A SpatialAudioException is thrown
if the call fails.
createCachedSoundSource
public abstract CachedSoundSource createCachedSoundSource(int flags,
InputStream dataSource,
int groupId,
Object eventArg,
Component target,
Object info) throws IOException, OutOfMemoryException, CorruptFileException, SpatialAudioException
- Creates a new CachedSoundSource.
- Parameters:
- flags - The flags used for creating the cached sound source.
The flags can be used additively to combine functionality. The
following RenderOptions values
are supported:
- NO_DOPPLER
Indicates that Doppler effects should not be calculated for this sound source.
- NO_ATTENUATE
Indicates that distance attenuation should not be performed on this sound source.
This flag is only valid if the NO_SPATIALIZE flag is
also specified.
- NO_SPATIALIZE
Indicates that spatialization should not be performed on this sound source.
Distance attenuation will still be provided unless the
NO_ATTENUATE flags is also specified.
- NO_REVERB
Indicates that reverberation should not be applied to this sound source.
- PREPROCESS
Indicates that the sound source should be preprocessed for greatest run-time
efficiency. This may increase the creation time for
the sound source.
- IN_MEMORY
Indicates that the sound source should be completely loaded in memory. This may
increase the creation time for the sound source.
- dataSource - The InputStream which will provide the data for the cached
sound source.
- groupId - The synchronization group identifier
for the sound source. Zero indicates that the sound source is not part of a
synchronization group.
- eventArg - The argument to the AWT Event that will be generated when
playback of the sound source is completed. The id of the event will have the
value SoundSource.PLAYBACK_EVENT. If eventArg is null, no notification
will be provided.
- target - The AWT Component to which the event should be directed.
- info - An Object that may be used to hold application-specific data.
- Returns:
- An instance of a CachedSoundSource object. A SpatialAudioException is thrown
if the creation fails.
createCachedSoundSource
public abstract CachedSoundSource createCachedSoundSource(int flags,
URL dataSource,
int groupId,
Object eventArg,
Component target,
Object info) throws IOException, OutOfMemoryException, CorruptFileException, SpatialAudioException
- Creates a new CachedSoundSource.
- Parameters:
- flags - The flags used for creating the cached sound source.
The flags can be used additively to combine functionality. The
following RenderOptions values
are supported:
NO_DOPPLER,
NO_ATTENUATE,
NO_SPATIALIZE,
NO_REVERB,
PREPROCESS,
IN_MEMORY
- dataSource - The InputStream which will provide the data for the cached
sound source.
- groupId - The synchronization group identifier
for the sound source. Zero indicates that the sound source is not part of a
synchronization group.
- eventArg - The argument to the AWT Event that will be generated when
playback of the sound source is completed. The id of the event will have the
value SoundSource.PLAYBACK_EVENT. If eventArg is null, no notification
will be provided.
- target - The AWT Component to which the event should be directed.
- info - An Object that may be used to hold application-specific data.
- Returns:
- An instance of a CachedSoundSource object. A SpatialAudioException is thrown
if the creation fails.
createCachedSoundSource
public abstract CachedSoundSource createCachedSoundSource(int flags,
String dataSource,
int groupId,
Object eventArg,
Component target,
Object info) throws IOException, OutOfMemoryException, CorruptFileException, SpatialAudioException
- Creates a new CachedSoundSource.
- Parameters:
- flags - The flags used for creating the cached sound source.
The flags can be used additively to combine functionality. The
following RenderOptions values
are supported:
NO_DOPPLER,
NO_ATTENUATE,
NO_SPATIALIZE,
NO_REVERB,
PREPROCESS,
IN_MEMORY
- dataSource - The InputStream which will provide the data for the cached
sound source.
- groupId - The synchronization group identifier
for the sound source. Zero indicates that the sound source is not part of a
synchronization group.
- eventArg - The argument to the AWT Event that will be generated when
playback of the sound source is completed. The id of the event will have the
value SoundSource.PLAYBACK_EVENT. If eventArg is null, no notification
will be provided.
- target - The AWT Component to which the event should be directed.
- info - An Object that may be used to hold application-specific data.
- Returns:
- An instance of a CachedSoundSource object. A SpatialAudioException is thrown
if the creation fails.
createCachedSoundSource
public abstract CachedSoundSource createCachedSoundSource(InputStream dataSource) throws IOException, OutOfMemoryException, CorruptFileException, SpatialAudioException
- Creates a new CachedSoundSource.
- Parameters:
- dataSource - The InputStream which will provide the data for the cached sound source.
- Returns:
- An instance of a CachedSoundSource object. A SpatialAudioException is thrown
if the creation fails.
createCachedSoundSource
public abstract CachedSoundSource createCachedSoundSource(URL dataSource) throws IOException, OutOfMemoryException, CorruptFileException, SpatialAudioException
- Creates a new CachedSoundSource.
- Parameters:
- dataSource - The fully qualified URL of the audio data for the sound source.
- Returns:
- An instance of a CachedSoundSource object. A SpatialAudioException is thrown
if the creation fails.
createCachedSoundSource
public abstract CachedSoundSource createCachedSoundSource(String dataSource) throws IOException, OutOfMemoryException, CorruptFileException, SpatialAudioException, MalformedURLException
- Creates a new CachedSoundSource.
- Parameters:
- dataSource - A String representation of the fully qualified URL of the audio data for the sound source.
- Returns:
- An instance of a CachedSoundSource object. A SpatialAudioException is thrown
if the creation fails.
createDirectListener
public abstract DirectListener createDirectListener() throws SpatialAudioException
- Creates a new DirectListener with a preferred audio
format of PCM_22K_16BIT_STEREO.
- Returns:
- An instance of a DirectListener object. A SpatialAudioException is thrown
if the creation fails.
createDirectListener
public abstract DirectListener createDirectListener(int format,
Object info) throws SpatialAudioException
- Creates a new DirectListener with the specified characteristics.
- Parameters:
- waveFormat - A WaveFormat value specifying the preferred format of the
audio input. A value of RenderOptions.DEFAULT indicates that the default audio
format, PCM_22K_16BIT_STEREO, should be used.
- info - May be used to store application-specific information. For platforms that support
Microsoft DirectSound*, this may be used to specify an AWT Component (such an
an Applet) from which a window handle is derived.
- Returns:
- An instance of a DirectListener object. A SpatialAudioException is thrown
if the creation fails.
createDirectListener
public abstract DirectListener createDirectListener(WaveFormat format,
Object info) throws SpatialAudioException
- Creates a new DirectListener with the specified characteristics.
- Parameters:
- waveFormat - The desired format for audio output. Use null for the default
preferred format, PCM_22K_16BIT_STEREO.
- info - May be used to store application-specific information. For platforms that support
Microsoft DirectSound*, this may be used to specify an AWT Component (such an
an Applet) from which a window handle is derived.
- Returns:
- An instance of a DirectListener object. A SpatialAudioException is thrown
if the creation fails.
createStreamingListener
public abstract StreamingListener createStreamingListener(int format) throws SpatialAudioException
- Creates a new streaming listener with the default characteristics.
- Parameters:
- format - A WaveFormat value specifying the desired format of the audio data produced
by the listener.
- Returns:
- An instance of a StreamingListener object. A SpatialAudioException is thrown
if the creation fails.
createStreamingListener
public abstract StreamingListener createStreamingListener(WaveFormat format,
int requestedBufferSize,
Object info) throws SpatialAudioException
- Creates a new StreamingListener with the specified characteristics.
- Parameters:
- format - The desired format of the audio data produced
by the listener.
- requestedBufferSize - The desired buffer size, in bytes for the Listener.
- info - May be used to store application-specific information.
- Returns:
- An instance of a StreamingListener object. A SpatialAudioException is thrown
if the creation fails.
createStreamingListener
public abstract StreamingListener createStreamingListener(int format,
int requestedBufferSize,
Object info) throws SpatialAudioException
- Creates a new StreamingListener with the specified characteristics.
- Parameters:
- format - A WaveFormat value specifying the desired format of the audio data produced
by the listener.
- requestedBufferSize - The desired buffer size, in bytes, for the Listener.
- info - May be used to store application-specific information.
- Returns:
- An instance of a StreamingListener object. A SpatialAudioException is thrown
if the creation fails.
getReverb
public abstract ReverbModel getReverb() throws SpatialAudioException
- Retrieves the current reverberation characteristics
of the sound environment.
- Returns:
- An instance of the ReverbModel class. A SpatialAudioException is thrown
if the call fails.
setReverb
public abstract boolean setReverb(ReverbModel reverb)
- Specifies the reverberation characteristics for
the Environment. These characteristics include the
reverberation state (on/off) as well as the delay time and
reverberation intensity.
- Parameters:
- reverb - An instance of the ReverbModel class containing the
reverberation parameters.
- Returns:
- true if the call succeeded, or false if it failed.
setReverb
public abstract boolean setReverb(int type)
- Specifies the reverberation characteristics for
the Environment.
- Parameters:
- type - A value representing the type of reverberation.
Valid values are ReverbModel.ROOM_REVERB, ReverbModel.CHAMBER_REVERB, ReverbModel.STAGE_REVERB,
ReverbModel.HALL_REVERB, and ReverbModel.PLATE_REVERB.
- Returns:
- true if the call succeeded, or false if it failed.
setInfo
public abstract void setInfo(Object info)
- Sets the info value for the Environment.
- Parameters:
- The - info value set by the application.
getInfo
public abstract Object getInfo()
- Retrieves the info value set by the application.
- Returns:
- The info value set by the application.
Returns null if the call fails, or if the info value has not been set.
release
public abstract void release()
- Indicates that the application has finished using this Environment, and
requests that any resources associated with the Environment
be freed. Normally, SpatialAudio.createEnvironment() should be called during
the initialization of the applet or application, and release() should be called
when the applet or application is destroyed.
Attempts to use the Environment object will fail after release() has been called.
All Packages Class Hierarchy This Package Previous Next Index