Package 

Class LocalAudioTrack

  • All Implemented Interfaces:
    com.twilio.video.Track

    
    public class LocalAudioTrack
    extends AudioTrack
                        

    Represents a local audio source.

    • Method Detail

      • create

        @Nullable() static LocalAudioTrack create(@NonNull() Context context, boolean enabled)

        Creates an audio track. Note that the RECORD_AUDIO permission must be granted in order forthis operation to succeed. If RECORD_AUDIO is not granted null is returned.

        Parameters:
        context - application context.
        enabled - initial state of audio track.
      • create

        @Nullable() static LocalAudioTrack create(@NonNull() Context context, boolean enabled, @Nullable() AudioOptions audioOptions)

        Creates an audio track. Note that the RECORD_AUDIO permission must be granted in order forthis operation to succeed. If RECORD_AUDIO is not granted null is returned.

        Parameters:
        context - application context.
        enabled - initial state of audio track.
        audioOptions - audio options to be applied to the track.
      • create

        @Nullable() static LocalAudioTrack create(@NonNull() Context context, boolean enabled, @Nullable() String name)

        Creates an audio track. Note that the RECORD_AUDIO permission must be granted in order forthis operation to succeed. If RECORD_AUDIO is not granted null is returned.

        Parameters:
        context - application context.
        enabled - initial state of audio track.
        name - audio track name.
      • create

        @Nullable() static LocalAudioTrack create(@NonNull() Context context, boolean enabled, @Nullable() AudioOptions audioOptions, @Nullable() String name)

        Creates an audio track. Note that the RECORD_AUDIO permission must be granted in order forthis operation to succeed. If RECORD_AUDIO is not granted null is returned.

        Parameters:
        context - application context.
        enabled - initial state of audio track.
        audioOptions - audio options to be applied to track.
        name - audio track name.
      • isEnabled

         synchronized boolean isEnabled()

        Check if the local audio track is enabled.

        When the value is false, the local audio track is muted. When the value is true the localaudio track is live.

      • getName

        @NonNull() String getName()

        Returns the local audio track name. A pseudo random string is returned if no track name wasspecified.

      • enable

         synchronized void enable(boolean enable)

        Sets the state of the local audio track. The results of this operation are signaled to otherParticipants in the same Room. When an audio track is disabled, the audio is muted.

        Parameters:
        enable - the desired state of the local audio track.
      • release

         synchronized void release()

        Releases native memory owned by audio track.

      • addSink

         synchronized void addSink(@NonNull() AudioSink audioSink)

        Adds a sink to the Track. Sinks consume raw audio samples for further processing or storage.

      • removeSink

         synchronized void removeSink(@NonNull() AudioSink audioSink)

        Removes a sink from the Track.

        Parameters:
        audioSink - An object that implements the `AudioSink` interface.