Lines Matching refs:AudioFormat

266     private int mChannelMask = AudioFormat.CHANNEL_OUT_MONO;
285 * May be set to {@link AudioFormat#CHANNEL_INVALID} if a channel index mask is specified.
287 private int mChannelConfiguration = AudioFormat.CHANNEL_OUT_MONO;
294 * @see AudioFormat#ENCODING_PCM_8BIT
295 * @see AudioFormat#ENCODING_PCM_16BIT
296 * @see AudioFormat#ENCODING_PCM_FLOAT
343 * See {@link AudioFormat#CHANNEL_OUT_MONO} and
344 * {@link AudioFormat#CHANNEL_OUT_STEREO}
346 * See {@link AudioFormat#ENCODING_PCM_16BIT},
347 * {@link AudioFormat#ENCODING_PCM_8BIT},
348 * and {@link AudioFormat#ENCODING_PCM_FLOAT}.
392 * See {@link AudioFormat#CHANNEL_OUT_MONO} and
393 * {@link AudioFormat#CHANNEL_OUT_STEREO}
395 * See {@link AudioFormat#ENCODING_PCM_16BIT} and
396 * {@link AudioFormat#ENCODING_PCM_8BIT},
397 * and {@link AudioFormat#ENCODING_PCM_FLOAT}.
416 (new AudioFormat.Builder())
426 * Class constructor with {@link AudioAttributes} and {@link AudioFormat}.
428 * @param format a non-null {@link AudioFormat} instance describing the format of the data
429 * that will be played through this AudioTrack. See {@link AudioFormat.Builder} for
445 public AudioTrack(AudioAttributes attributes, AudioFormat format, int bufferSizeInBytes,
454 throw new IllegalArgumentException("Illegal null AudioFormat");
464 if ((format.getPropertySetMask() & AudioFormat.AUDIO_FORMAT_HAS_PROPERTY_SAMPLE_RATE) != 0)
475 & AudioFormat.AUDIO_FORMAT_HAS_PROPERTY_CHANNEL_INDEX_MASK) != 0) {
480 & AudioFormat.AUDIO_FORMAT_HAS_PROPERTY_CHANNEL_MASK) != 0) {
483 channelMask = AudioFormat.CHANNEL_OUT_FRONT_LEFT
484 | AudioFormat.CHANNEL_OUT_FRONT_RIGHT;
486 int encoding = AudioFormat.ENCODING_DEFAULT;
487 if ((format.getPropertySetMask() & AudioFormat.AUDIO_FORMAT_HAS_PROPERTY_ENCODING) != 0) {
530 * <p> Here is an example where <code>Builder</code> is used to specify all {@link AudioFormat}
539 * .setAudioFormat(new AudioFormat.Builder()
540 * .setEncoding(AudioFormat.ENCODING_PCM_16BIT)
542 * .setChannelMask(AudioFormat.CHANNEL_OUT_STEREO)
553 * {@link AudioFormat#CHANNEL_OUT_STEREO} and the encoding will be
554 * {@link AudioFormat#ENCODING_PCM_16BIT}.
564 private AudioFormat mFormat;
594 * See {@link AudioFormat.Builder} for configuring the audio format parameters such
596 * @param format a non-null {@link AudioFormat} instance.
600 public @NonNull Builder setAudioFormat(@NonNull AudioFormat format)
603 throw new IllegalArgumentException("Illegal null AudioFormat argument");
687 mFormat = new AudioFormat.Builder()
688 .setChannelMask(AudioFormat.CHANNEL_OUT_STEREO)
690 .setEncoding(AudioFormat.ENCODING_DEFAULT)
717 AudioFormat.CHANNEL_OUT_FRONT_LEFT |
718 AudioFormat.CHANNEL_OUT_FRONT_RIGHT |
719 AudioFormat.CHANNEL_OUT_FRONT_CENTER |
720 AudioFormat.CHANNEL_OUT_LOW_FREQUENCY |
721 AudioFormat.CHANNEL_OUT_BACK_LEFT |
722 AudioFormat.CHANNEL_OUT_BACK_RIGHT |
723 AudioFormat.CHANNEL_OUT_BACK_CENTER |
724 AudioFormat.CHANNEL_OUT_SIDE_LEFT |
725 AudioFormat.CHANNEL_OUT_SIDE_RIGHT;
750 case AudioFormat.CHANNEL_OUT_DEFAULT: //AudioFormat.CHANNEL_CONFIGURATION_DEFAULT
751 case AudioFormat.CHANNEL_OUT_MONO:
752 case AudioFormat.CHANNEL_CONFIGURATION_MONO:
754 mChannelMask = AudioFormat.CHANNEL_OUT_MONO;
756 case AudioFormat.CHANNEL_OUT_STEREO:
757 case AudioFormat.CHANNEL_CONFIGURATION_STEREO:
759 mChannelMask = AudioFormat.CHANNEL_OUT_STEREO;
762 if (channelConfig == AudioFormat.CHANNEL_INVALID && channelIndexMask != 0) {
771 mChannelCount = AudioFormat.channelCountFromOutChannelMask(channelConfig);
792 if (audioFormat == AudioFormat.ENCODING_DEFAULT) {
793 audioFormat = AudioFormat.ENCODING_PCM_16BIT;
796 if (!AudioFormat.isPublicEncoding(audioFormat)) {
804 ((mode != MODE_STREAM) && !AudioFormat.isEncodingLinearPcm(mAudioFormat))) {
821 final int channelCount = AudioFormat.channelCountFromOutChannelMask(channelConfig);
831 AudioFormat.CHANNEL_OUT_FRONT_LEFT | AudioFormat.CHANNEL_OUT_FRONT_RIGHT;
837 AudioFormat.CHANNEL_OUT_BACK_LEFT | AudioFormat.CHANNEL_OUT_BACK_RIGHT;
845 AudioFormat.CHANNEL_OUT_SIDE_LEFT | AudioFormat.CHANNEL_OUT_SIDE_RIGHT;
865 if (AudioFormat.isEncodingLinearPcm(mAudioFormat)) {
866 frameSizeInBytes = mChannelCount * AudioFormat.getBytesPerSample(mAudioFormat);
949 * Returns the configured audio data encoding. See {@link AudioFormat#ENCODING_PCM_8BIT},
950 * {@link AudioFormat#ENCODING_PCM_16BIT}, and {@link AudioFormat#ENCODING_PCM_FLOAT}.
969 * <p> For example, refer to {@link AudioFormat#CHANNEL_OUT_MONO},
970 * {@link AudioFormat#CHANNEL_OUT_STEREO}, {@link AudioFormat#CHANNEL_OUT_5POINT1}.
971 * This method may return {@link AudioFormat#CHANNEL_INVALID} if
973 * {@link #getFormat()} instead, to obtain an {@link AudioFormat},
982 * @return an {@link AudioFormat} containing the
985 public @NonNull AudioFormat getFormat() {
986 AudioFormat.Builder builder = new AudioFormat.Builder()
989 if (mChannelConfiguration != AudioFormat.CHANNEL_INVALID) {
992 if (mChannelIndexMask != AudioFormat.CHANNEL_INVALID /* 0 */) {
1041 * e.g. {@link AudioFormat#ENCODING_AC3}, then the frame count returned is
1124 * See {@link AudioFormat#CHANNEL_OUT_MONO} and
1125 * {@link AudioFormat#CHANNEL_OUT_STEREO}
1127 * See {@link AudioFormat#ENCODING_PCM_16BIT} and
1128 * {@link AudioFormat#ENCODING_PCM_8BIT},
1129 * and {@link AudioFormat#ENCODING_PCM_FLOAT}.
1137 case AudioFormat.CHANNEL_OUT_MONO:
1138 case AudioFormat.CHANNEL_CONFIGURATION_MONO:
1141 case AudioFormat.CHANNEL_OUT_STEREO:
1142 case AudioFormat.CHANNEL_CONFIGURATION_STEREO:
1150 channelCount = AudioFormat.channelCountFromOutChannelMask(channelConfig);
1154 if (!AudioFormat.isPublicEncoding(audioFormat)) {
1673 * {@link AudioFormat#ENCODING_PCM_8BIT} to correspond to the data in the array.
1707 * {@link AudioFormat#ENCODING_PCM_8BIT} to correspond to the data in the array.
1742 if (mState == STATE_UNINITIALIZED || mAudioFormat == AudioFormat.ENCODING_PCM_FLOAT) {
1774 * {@link AudioFormat#ENCODING_PCM_16BIT} to correspond to the data in the array.
1808 * {@link AudioFormat#ENCODING_PCM_16BIT} to correspond to the data in the array.
1842 if (mState == STATE_UNINITIALIZED || mAudioFormat == AudioFormat.ENCODING_PCM_FLOAT) {
1874 * {@link AudioFormat#ENCODING_PCM_FLOAT} to correspond to the data in the array.
1923 if (mAudioFormat != AudioFormat.ENCODING_PCM_FLOAT) {