Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -23250,6 +23250,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 +23 −0 Original line number Diff line number Diff line Loading @@ -370,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 @@ -570,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 @@ -1300,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 @@ -23250,6 +23250,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 +23 −0 Original line number Diff line number Diff line Loading @@ -370,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 @@ -570,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 @@ -1300,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