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
read
method 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 TypeMethodDescriptionboolean
Indicates if the track is or is not being included in theAudioMixer
media out.float[]
Reads one buffer of normalized audio data frames of the track.void
setTrackRunning
(boolean bool) Used to set whether or not thisAudioMixerTrack
is to be included in theAudioMixer
media out.
-
Method Details
-
isTrackRunning
boolean isTrackRunning()Indicates if the track is or is not being included in theAudioMixer
media 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:
true
if the track is being included in the mix, otherwisefalse
-
setTrackRunning
void setTrackRunning(boolean bool) Used to set whether or not thisAudioMixerTrack
is to be included in theAudioMixer
media out. When set totrue
, thisAudioMixerTrack
will 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, iffalse
this 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
-