Package com.adonax.audiocue
Interface AudioMixerTrack
- All Known Implementing Classes:
AudioCue
public interface AudioMixerTrack
An interface for classes that make audio data available to an
AudioMixer for media play via the read method.
Objects that implement AudioMixerTrack can either be (1) running,
or (2) not running. There are no explicit restrictions related to the
relationship between the state and the read method. Nor are there any
restrictions or promises made as to the content of the returned float
array.
However, in this package, the following conditions have been implemented:
- The
readmethod will only be executed after the track is first shown to be in a running state; - the read array is expected to consist of signed, normalized floats of stereo PCM encoded at 44100 frames per second.
With these constraints in place, the media write of audio from the track can in effect be muted by setting the state to not running, and the media writes can be set to resume by setting the state to running.
- Since:
- 2.0.0
- Version:
- 2.0.0
- Author:
- Philip Freihofner
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates if the track is or is not being included in theAudioMixermedia out.float[]Reads one buffer of normalized audio data frames of the track.voidsetTrackRunning(boolean bool) Used to set whether or not thisAudioMixerTrackis to be included in theAudioMixermedia out.
-
Method Details
-
isTrackRunning
boolean isTrackRunning()Indicates if the track is or is not being included in theAudioMixermedia out. If the method returnstrue, this track is included in the mix. Iffalse, the track is ignored, as if a 'mute' button had been pressed.- Returns:
trueif the track is being included in the mix, otherwisefalse
-
setTrackRunning
void setTrackRunning(boolean bool) Used to set whether or not thisAudioMixerTrackis to be included in theAudioMixermedia out. When set totrue, thisAudioMixerTrackwill be included in the audio mix. When set tofalse, this track will be ignored, and not included in the audio mix, as if a 'mute' button had been pressed.- Parameters:
bool- - iftrue, this track will be included in the audio mix, iffalsethis track will not be included
-
readTrack
Reads one buffer of normalized audio data frames of the track.- Returns:
- one buffer of normalized audio frames
- Throws:
IOException- if an I/O exception occurs
-