public class LocalAudioTrack extends AudioTrack
audioSinks
Modifier and Type | Method and Description |
---|---|
void |
addSink(AudioSink audioSink)
Adds a sink to the Track.
|
static LocalAudioTrack |
create(android.content.Context context,
boolean enabled)
Creates an audio track.
|
static LocalAudioTrack |
create(android.content.Context context,
boolean enabled,
AudioOptions audioOptions)
Creates an audio track.
|
static LocalAudioTrack |
create(android.content.Context context,
boolean enabled,
AudioOptions audioOptions,
java.lang.String name)
Creates an audio track.
|
static LocalAudioTrack |
create(android.content.Context context,
boolean enabled,
java.lang.String name)
Creates an audio track.
|
void |
enable(boolean enable)
Sets the state of the local audio track.
|
java.lang.String |
getName()
Returns the local audio track name.
|
boolean |
isEnabled()
Check if the local audio track is enabled.
|
void |
release()
Releases native memory owned by audio track.
|
void |
removeSink(AudioSink audioSink)
Removes a sink from the Track.
|
@Nullable public static LocalAudioTrack create(@NonNull android.content.Context context, boolean enabled)
context
- application context.enabled
- initial state of audio track.@Nullable public static LocalAudioTrack create(@NonNull android.content.Context context, boolean enabled, @Nullable AudioOptions audioOptions)
context
- application context.enabled
- initial state of audio track.audioOptions
- audio options to be applied to the track.@Nullable public static LocalAudioTrack create(@NonNull android.content.Context context, boolean enabled, @Nullable java.lang.String name)
context
- application context.enabled
- initial state of audio track.name
- audio track name.@Nullable public static LocalAudioTrack create(@NonNull android.content.Context context, boolean enabled, @Nullable AudioOptions audioOptions, @Nullable java.lang.String name)
context
- application context.enabled
- initial state of audio track.audioOptions
- audio options to be applied to track.name
- audio track name.public boolean isEnabled()
When the value is false, the local audio track is muted. When the value is true the local audio track is live.
isEnabled
in interface Track
isEnabled
in class AudioTrack
@NonNull public java.lang.String getName()
getName
in interface Track
getName
in class AudioTrack
public void enable(boolean enable)
enable
- the desired state of the local audio track.public void release()
public void addSink(@NonNull AudioSink audioSink)
addSink
in class AudioTrack
public void removeSink(@NonNull AudioSink audioSink)
removeSink
in class AudioTrack
audioSink
- An object that implements the `AudioSink` interface.7.0.0