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

METHOD INDEX

 O createCachedSoundSource(InputStream)
Creates a new CachedSoundSource.
 O createCachedSoundSource(int, InputStream, int, Object, Component, Object)
Creates a new CachedSoundSource.
 O createCachedSoundSource(int, String, int, Object, Component, Object)
Creates a new CachedSoundSource.
 O createCachedSoundSource(int, URL, int, Object, Component, Object)
Creates a new CachedSoundSource.
 O createCachedSoundSource(String)
Creates a new CachedSoundSource.
 O createCachedSoundSource(URL)
Creates a new CachedSoundSource.
 O createDirectListener()
Creates a new DirectListener with a preferred audio format of PCM_22K_16BIT_STEREO.
 O createDirectListener(int, Object)
Creates a new DirectListener with the specified characteristics.
 O createDirectListener(WaveFormat, Object)
Creates a new DirectListener with the specified characteristics.
 O createStreamingListener(int)
Creates a new streaming listener with the default characteristics.
 O createStreamingListener(int, int, Object)
Creates a new StreamingListener with the specified characteristics.
 O createStreamingListener(WaveFormat, int, Object)
Creates a new StreamingListener with the specified characteristics.
 O createStreamingSoundSource(int)
Creates a new StreamingSoundSource with the preferred format specified.
 O createStreamingSoundSource(int, int, int, Object)
Creates a new StreamingSoundSource with the preferred format specified.
 O createStreamingSoundSource(int, int, WaveFormat, Object)
Creates a new StreamingSoundSource with the preferred format specified.
 O getInfo()
Retrieves the info value set by the application.
 O getModel()
Retrieves the current characteristics of the sound Environment.
 O getReverb()
Retrieves the current reverberation characteristics of the sound environment.
 O release()
Indicates that the application has finished using this Environment, and requests that any resources associated with the Environment be freed.
 O setInfo(Object)
Sets the info value for the Environment.
 O setModel(EnvironmentModel)
Sets the current characteristics of the sound Environment.
 O setReverb(int)
Specifies the reverberation characteristics for the Environment.
 O setReverb(ReverbModel)
Specifies the reverberation characteristics for the Environment.

METHODS

 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O 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.
 O setInfo
  public abstract void setInfo(Object info)
Sets the info value for the Environment.
Parameters:
The - info value set by the application.
 O 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.
 O 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
Free Web Hosting