fm.liveswitch.android.AudioTrackSink Class Reference

An Android AudioTrack-based sink. More...

Public Member Functions

int getAudioUsage ()
 Gets the desired audio usage (AudioAttributes.USAGE_*). Defaults to AudioAttributes.USAGE_VOICE_COMMUNICATION. More...
 
void setAudioUsage (int audioUsage)
 Sets the desired audio usage (AudioAttributes.USAGE_*). Defaults to AudioAttributes.USAGE_VOICE_COMMUNICATION. More...
 
int getAudioContentType ()
 Gets the desired audio content type (AudioAttributes.CONTENT_TYPE_*). Defaults to AudioAttributes.CONTENT_TYPE_SPEECH. More...
 
void setAudioContentType (int audioContentType)
 Sets the desired audio content type (AudioAttributes.CONTENT_TYPE_*). Defaults to AudioAttributes.CONTENT_TYPE_SPEECH. More...
 
String getLabel ()
 Gets a label that identifies this class. More...
 
 AudioTrackSink (AudioConfig config)
 Initializes a new instance of the AudioTrackSink class. More...
 
 AudioTrackSink (IAudioOutput input)
 Initializes a new instance of the AudioTrackSink class. More...
 
 AudioTrackSink (IAudioOutput[] inputs)
 Initializes a new instance of the AudioTrackSink class. More...
 
- Public Member Functions inherited from fm.liveswitch.AudioSink
 AudioSink ()
 Initializes a new instance of the fm.liveswitch.AudioSink class. More...
 
 AudioSink (fm.liveswitch.AudioFormat inputFormat)
 Initializes a new instance of the fm.liveswitch.AudioSink class. More...
 
fm.liveswitch.AudioConfig getConfig ()
 Gets the input configuration. More...
 
double getGain ()
 Gets a value indicating the gain (input amplification) of this sink. More...
 
boolean processFrame (fm.liveswitch.AudioFrame frame)
 Processes a frame. More...
 
void setGain (double value)
 Sets a value indicating the gain (input amplification) of this sink. More...
 
- Public Member Functions inherited from fm.liveswitch.MediaSinkBase
String getExternalId ()
 Gets the external identifier. More...
 
String getId ()
 Gets the identifier. More...
 
String getTag ()
 Gets optional data to associate with this instance. More...
 
void setExternalId (String value)
 Sets the external identifier. More...
 
void setTag (String value)
 Sets optional data to associate with this instance. More...
 
- Public Member Functions inherited from fm.liveswitch.Dynamic
java.util.HashMap< String, Object > getDynamicProperties ()
 Gets all dynamic properties on this instance. More...
 
Object getDynamicValue (String key)
 Gets a property value from the local cache. More...
 
void setDynamicValue (String key, Object value)
 Sets a property value in the local cache. More...
 
boolean unsetDynamicValue (String key)
 Removes a property value from the local cache. More...
 
- Public Member Functions inherited from fm.liveswitch.IElement
abstract String getExternalId ()
 Gets the external identifier. More...
 
abstract String getId ()
 Gets the identifier. More...
 
abstract String getPipelineJson ()
 Gets the pipeline JSON with this as the central point. More...
 
abstract void setExternalId (String value)
 Sets the external identifier. More...
 
- Public Member Functions inherited from fm.liveswitch.IMediaElement
abstract boolean destroy ()
 Destroys this instance. More...
 
abstract boolean getDeactivated ()
 Gets a value indicating whether this instance is deactivated. More...
 
abstract boolean getDisabled ()
 Gets a value indicating whether this instance is disabled. More...
 
abstract boolean getMuted ()
 Gets a value indicating whether this instance is muted. More...
 
abstract boolean getPaused ()
 Gets a value indicating whether this instance is paused. More...
 
abstract boolean getPersistent ()
 Gets a value indicating whether this instance is persistent. More...
 
abstract void setDeactivated (boolean value)
 Sets a value indicating whether this instance is deactivated. More...
 
abstract void setMuted (boolean value)
 Sets a value indicating whether this instance is muted. More...
 

Static Public Member Functions

static int getBufferDelay (AudioConfig config)
 Gets the length of the audio buffer in milliseconds. More...
 

Protected Member Functions

void doDestroy ()
 
void doProcessFrame (AudioFrame frame, AudioBuffer inputBuffer)
 
- Protected Member Functions inherited from fm.liveswitch.AudioSink
fm.liveswitch.IAudioOutputCollection createOutputCollection (fm.liveswitch.IAudioInput input)
 Creates an output collection. More...
 
- Protected Member Functions inherited from fm.liveswitch.MediaSinkBase
 MediaSinkBase ()
 
- Protected Member Functions inherited from fm.liveswitch.Dynamic
 Dynamic ()
 
- Protected Member Functions inherited from fm.liveswitch.Serializable
boolean getIsDirty ()
 Gets a value indicating whether this instance is dirty. More...
 
 Serializable ()
 Initializes a new instance of the fm.liveswitch.Serializable class. More...
 
void setIsDirty (boolean value)
 Sets a value indicating whether this instance is dirty. More...
 

Detailed Description

An Android AudioTrack-based sink.

Constructor & Destructor Documentation

◆ AudioTrackSink() [1/3]

fm.liveswitch.android.AudioTrackSink.AudioTrackSink ( AudioConfig  config)

Initializes a new instance of the AudioTrackSink class.

Parameters
configThe configuration.

◆ AudioTrackSink() [2/3]

fm.liveswitch.android.AudioTrackSink.AudioTrackSink ( IAudioOutput  input)

Initializes a new instance of the AudioTrackSink class.

Parameters
inputThe input.

◆ AudioTrackSink() [3/3]

fm.liveswitch.android.AudioTrackSink.AudioTrackSink ( IAudioOutput[]  inputs)

Initializes a new instance of the AudioTrackSink class.

Parameters
inputsThe inputs.

Member Function Documentation

◆ doDestroy()

void fm.liveswitch.android.AudioTrackSink.doDestroy ( )
protected

◆ doProcessFrame()

void fm.liveswitch.android.AudioTrackSink.doProcessFrame ( AudioFrame  frame,
AudioBuffer  inputBuffer 
)
protected

◆ getAudioContentType()

int fm.liveswitch.android.AudioTrackSink.getAudioContentType ( )

Gets the desired audio content type (AudioAttributes.CONTENT_TYPE_*). Defaults to AudioAttributes.CONTENT_TYPE_SPEECH.

◆ getAudioUsage()

int fm.liveswitch.android.AudioTrackSink.getAudioUsage ( )

Gets the desired audio usage (AudioAttributes.USAGE_*). Defaults to AudioAttributes.USAGE_VOICE_COMMUNICATION.

◆ getBufferDelay()

static int fm.liveswitch.android.AudioTrackSink.getBufferDelay ( AudioConfig  config)
static

Gets the length of the audio buffer in milliseconds.

◆ getLabel()

String fm.liveswitch.android.AudioTrackSink.getLabel ( )

Gets a label that identifies this class.

Implements fm.liveswitch.IMediaElement.

◆ setAudioContentType()

void fm.liveswitch.android.AudioTrackSink.setAudioContentType ( int  audioContentType)

Sets the desired audio content type (AudioAttributes.CONTENT_TYPE_*). Defaults to AudioAttributes.CONTENT_TYPE_SPEECH.

◆ setAudioUsage()

void fm.liveswitch.android.AudioTrackSink.setAudioUsage ( int  audioUsage)

Sets the desired audio usage (AudioAttributes.USAGE_*). Defaults to AudioAttributes.USAGE_VOICE_COMMUNICATION.