Language

AudioFormat.Builder.SetChannelIndexMask(Int32) Method

Definition

Sets the channel index mask.

[Android.Runtime.Register("setChannelIndexMask", "(I)Landroid/media/AudioFormat$Builder;", "GetSetChannelIndexMask_IHandler", ApiSince=23)]
public virtual Android.Media.AudioFormat.Builder SetChannelIndexMask(int channelIndexMask);
[<Android.Runtime.Register("setChannelIndexMask", "(I)Landroid/media/AudioFormat$Builder;", "GetSetChannelIndexMask_IHandler", ApiSince=23)>]
abstract member SetChannelIndexMask : int -> Android.Media.AudioFormat.Builder
override this.SetChannelIndexMask : int -> Android.Media.AudioFormat.Builder

Parameters

channelIndexMask
Int32

describes the configuration of the audio channels. For output, the channelIndexMask is an OR-ed combination of bits representing the mapping of AudioTrack write samples to output sink channels. For example, a mask of 0xa, or binary 1010, means the AudioTrack write frame consists of two samples, which are routed to the second and the fourth channels of the output sink. Unmatched output sink channels are zero filled and unmatched AudioTrack write samples are dropped. For input, the channelIndexMask is an OR-ed combination of bits representing the mapping of input source channels to AudioRecord read samples. For example, a mask of 0x5, or binary 101, will read from the first and third channel of the input source device and store them in the first and second sample of the AudioRecord read frame. Unmatched input source channels are dropped and unmatched AudioRecord read samples are zero filled.

Returns

the same Builder instance. This value cannot be null.

Attributes

Remarks

Sets the channel index mask. A channel index mask specifies the association of audio samples in the frame with numbered endpoint channels. The i-th bit in the channel index mask corresponds to the i-th endpoint channel. For example, an endpoint with four channels is represented as index mask bits 0 through 3. This

Android reference for android.media.AudioFormat.Builder.setChannelIndexMask.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to