Interface spatialAudio.CachedSoundSource
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface spatialAudio.CachedSoundSource

public interface CachedSoundSource
extends Object
extends SoundSource
The CachedSoundSource interface provides the functionality specific to cached sound sources. This includes standard media controls (play, pause, stop, and resume) and playback marks. Playback marks can be used to specify sections within a file which should be used for playback.

Copyright (c) 1996 Intel Corporation

See Also:
SoundSource, PlaybackMark, MediaState

METHOD INDEX

 O getCacheTime()
Retrieves the pre-load length for the sound source data, in seconds.
 O getPlaybackMarks()
Retrieves the begin and end playback marks for a cached sound source.
 O getPlayState()
Retrieves the play state of the SoundSource.
 O setCacheTime(float)
Sets the pre-load length for the sound source data, in seconds.
 O setPlaybackMarks(float, float)
Sets the begin and end playback marks for a cached sound source.
 O setPlaybackMarks(PlaybackMark)
Sets the begin and end playback marks for a cached sound source.
 O setPlayState(int)
Sets the play state of the sound source (play, pause, stop, and resume).
 O setPlayState(int, int, float)
Performs standard media control functions on the sound source (play, pause, stop, and resume).

METHODS

 O setPlayState
  public abstract boolean setPlayState(int control,
                                       int numLoops,
                                       float initialStartTime)
Performs standard media control functions on the sound source (play, pause, stop, and resume). The play position is specified in seconds using floating point precision. The position is rounded to the nearest sample.
Parameters:
control - Specifies the type of control operation to perform on the sound source. It must be one of the following MediaState values:
  • AUDIO_PLAY: Start playing the sound from the specified starting position and continue until the specified ending position for the number of iterations specified by numLoops. When the play is completed, the sound source is placed in the AUDIO_STOP state.
  • AUDIO_PAUSE: Stop playing the sound, but do not reset its play position.
  • AUDIO_RESUME: Continue playing the sound from the last paused position.
  • AUDIO_STOP: Stop playing the sound regardless of state.
numLoops - Specifies the number of audio loops to play. Loops are played over the region specified by current playback marks, or over the whole audio file by default. Zero indicates continuous looping. This parameter only applies when the AUDIO_PLAY control is specified.
initialStartTime - Specifies the starting position in seconds from the beginning of the file for the first loop of playback. This parameter only applies when the AUDIO_PLAY control is specified.
Returns:
true if the call succeeded, or false if it failed.
 O setPlayState
  public abstract boolean setPlayState(int control)
Sets the play state of the sound source (play, pause, stop, and resume). The play position is specified in seconds using floating point precision. The position is rounded to the nearest sample.
Parameters:
control - Specifies the type of control operation to perform on the sound source. It must be one of the following MediaState values:
  • AUDIO_PLAY: Start looping the sound, from beginning to end.
  • AUDIO_PAUSE: Stop playing the sound, but do not reset its play position.
  • AUDIO_RESUME: Continue playing the sound from the last paused position.
  • AUDIO_STOP: Stop playing the sound regardless of state.
 O getPlayState
  public abstract int getPlayState()
Retrieves the play state of the SoundSource.
Returns:
A MediaState value indicating the current play state of the cached sound source. Valid return values include AUDIO_PAUSE, AUDIO_RESUME, and AUDIO_STOP. A return value of zero indicates that the call failed.
 O getPlaybackMarks
  public abstract PlaybackMark getPlaybackMarks() throws SpatialAudioException
Retrieves the begin and end playback marks for a cached sound source. Playback marks specify a region of an audio file which should be used for playback.
Returns:
an instance of the PlaybackMark class containing the current begin and end playback marks for the cached sound source. If the call fails, a SpatialAudioException is thrown.
 O setPlaybackMarks
  public abstract boolean setPlaybackMarks(PlaybackMark playbackMark)
Sets the begin and end playback marks for a cached sound source. Playback marks specify a region of an audio file which should be used for playback. The start position must be less than the end position. By default, the beginTime and endTime values are zero, indicating that the entire file should be played.
Parameters:
playbackMark - An instance of the PlaybackMark class which holds the begin and end playback marks for the cached sound source.
Returns:
true if the call succeeded, or false if it failed.
 O setPlaybackMarks
  public abstract boolean setPlaybackMarks(float beginTime,
                                           float endTime)
Sets the begin and end playback marks for a cached sound source. Playback marks specify a region of an audio file which should be used for playback. The start position must be less than the end position. By default,the beginTime and endTime values are zero, indicating that the entire file should be played.
Parameters:
beginTime - The starting position in seconds for sound source playback within the file. Zero indicates that the starting position is the file’s beginning.
endTime - The ending position in seconds for sound source playback within the file. Zero indicates the ending position of the file
Returns:
true if the call succeeded, or false if it failed.
 O setCacheTime
  public abstract boolean setCacheTime(float cacheTime)
Sets the pre-load length for the sound source data, in seconds. Setting the cache time overrides the default value chosen by the audio renderer. The cache time must be equal to or greater than one second; the maximum cache time depends on the available system memory.
Returns:
true if the call succeeded, or false if it failed.
 O getCacheTime
  public abstract float getCacheTime()
Retrieves the pre-load length for the sound source data, in seconds.
Returns:
The cache time for the sound source data.

All Packages  Class Hierarchy  This Package  Previous  Next  Index
Free Web Hosting