Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -23251,6 +23251,7 @@ package android.media { method public android.media.VolumeShaper createVolumeShaper(android.media.VolumeShaper.Configuration); method protected void finalize(); method public void flush(); method public android.media.AudioAttributes getAudioAttributes(); method public int getAudioFormat(); method public int getAudioSessionId(); method public int getBufferCapacityInFrames(); media/java/android/media/AudioTrack.java +33 −11 Original line number Diff line number Diff line Loading @@ -16,23 +16,13 @@ package android.media; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; import java.lang.Math; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.NioUtils; import java.util.LinkedList; import java.util.concurrent.Executor; import android.annotation.CallbackExecutor; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; import android.os.Build; import android.os.Binder; import android.os.Build; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; Loading @@ -43,6 +33,15 @@ import android.util.Log; import com.android.internal.annotations.GuardedBy; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.NioUtils; import java.util.LinkedList; import java.util.concurrent.Executor; /** * The AudioTrack class manages and plays a single audio resource for Java applications. * It allows streaming of PCM audio buffers to the audio sink for playback. This is Loading Loading @@ -371,6 +370,10 @@ public class AudioTrack extends PlayerBase * @see AudioFormat#ENCODING_PCM_FLOAT */ private int mAudioFormat; // initialized by all constructors via audioParamCheck() /** * The AudioAttributes used in configuration. */ private AudioAttributes mConfiguredAudioAttributes; /** * Audio session ID */ Loading Loading @@ -571,6 +574,8 @@ public class AudioTrack extends PlayerBase super(attributes, AudioPlaybackConfiguration.PLAYER_TYPE_JAM_AUDIOTRACK); // mState already == STATE_UNINITIALIZED mConfiguredAudioAttributes = attributes; // object copy not needed, immutable. if (format == null) { throw new IllegalArgumentException("Illegal null AudioFormat"); } Loading Loading @@ -1301,6 +1306,23 @@ public class AudioTrack extends PlayerBase return native_get_playback_params(); } /** * Returns the {@link AudioAttributes} used in configuration. * If a {@code streamType} is used instead of an {@code AudioAttributes} * to configure the AudioTrack * (the use of {@code streamType} for configuration is deprecated), * then the {@code AudioAttributes} * equivalent to the {@code streamType} is returned. * @return The {@code AudioAttributes} used to configure the AudioTrack. * @throws IllegalStateException If the track is not initialized. */ public @NonNull AudioAttributes getAudioAttributes() { if (mState == STATE_UNINITIALIZED || mConfiguredAudioAttributes == null) { throw new IllegalStateException("track not initialized"); } return mConfiguredAudioAttributes; } /** * Returns the configured audio data encoding. See {@link AudioFormat#ENCODING_PCM_8BIT}, * {@link AudioFormat#ENCODING_PCM_16BIT}, and {@link AudioFormat#ENCODING_PCM_FLOAT}. Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -23251,6 +23251,7 @@ package android.media { method public android.media.VolumeShaper createVolumeShaper(android.media.VolumeShaper.Configuration); method protected void finalize(); method public void flush(); method public android.media.AudioAttributes getAudioAttributes(); method public int getAudioFormat(); method public int getAudioSessionId(); method public int getBufferCapacityInFrames();
media/java/android/media/AudioTrack.java +33 −11 Original line number Diff line number Diff line Loading @@ -16,23 +16,13 @@ package android.media; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; import java.lang.Math; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.NioUtils; import java.util.LinkedList; import java.util.concurrent.Executor; import android.annotation.CallbackExecutor; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; import android.os.Build; import android.os.Binder; import android.os.Build; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; Loading @@ -43,6 +33,15 @@ import android.util.Log; import com.android.internal.annotations.GuardedBy; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.NioUtils; import java.util.LinkedList; import java.util.concurrent.Executor; /** * The AudioTrack class manages and plays a single audio resource for Java applications. * It allows streaming of PCM audio buffers to the audio sink for playback. This is Loading Loading @@ -371,6 +370,10 @@ public class AudioTrack extends PlayerBase * @see AudioFormat#ENCODING_PCM_FLOAT */ private int mAudioFormat; // initialized by all constructors via audioParamCheck() /** * The AudioAttributes used in configuration. */ private AudioAttributes mConfiguredAudioAttributes; /** * Audio session ID */ Loading Loading @@ -571,6 +574,8 @@ public class AudioTrack extends PlayerBase super(attributes, AudioPlaybackConfiguration.PLAYER_TYPE_JAM_AUDIOTRACK); // mState already == STATE_UNINITIALIZED mConfiguredAudioAttributes = attributes; // object copy not needed, immutable. if (format == null) { throw new IllegalArgumentException("Illegal null AudioFormat"); } Loading Loading @@ -1301,6 +1306,23 @@ public class AudioTrack extends PlayerBase return native_get_playback_params(); } /** * Returns the {@link AudioAttributes} used in configuration. * If a {@code streamType} is used instead of an {@code AudioAttributes} * to configure the AudioTrack * (the use of {@code streamType} for configuration is deprecated), * then the {@code AudioAttributes} * equivalent to the {@code streamType} is returned. * @return The {@code AudioAttributes} used to configure the AudioTrack. * @throws IllegalStateException If the track is not initialized. */ public @NonNull AudioAttributes getAudioAttributes() { if (mState == STATE_UNINITIALIZED || mConfiguredAudioAttributes == null) { throw new IllegalStateException("track not initialized"); } return mConfiguredAudioAttributes; } /** * Returns the configured audio data encoding. See {@link AudioFormat#ENCODING_PCM_8BIT}, * {@link AudioFormat#ENCODING_PCM_16BIT}, and {@link AudioFormat#ENCODING_PCM_FLOAT}. Loading