AudioTrack.GetMinBufferSize(Int32, ChannelOut, Encoding) Method

Definition

Returns the estimated minimum buffer size required for an AudioTrack object to be created in the #MODE_STREAM mode.

[Android.Runtime.Register("getMinBufferSize", "(III)I", "")]
public static int GetMinBufferSize (int sampleRateInHz, Android.Media.ChannelOut channelConfig, Android.Media.Encoding audioFormat);
[<Android.Runtime.Register("getMinBufferSize", "(III)I", "")>]
static member GetMinBufferSize : int * Android.Media.ChannelOut * Android.Media.Encoding -> int

Parameters

sampleRateInHz
Int32

the source sample rate expressed in Hz. AudioFormat#SAMPLE_RATE_UNSPECIFIED is not permitted.

channelConfig
ChannelOut

describes the configuration of the audio channels. See AudioFormat#CHANNEL_OUT_MONO and AudioFormat#CHANNEL_OUT_STEREO

audioFormat
Encoding

the format in which the audio data is represented. See AudioFormat#ENCODING_PCM_16BIT and AudioFormat#ENCODING_PCM_8BIT, and AudioFormat#ENCODING_PCM_FLOAT.

Returns

Int32

#ERROR_BAD_VALUE if an invalid parameter was passed, or #ERROR if unable to query for output properties, or the minimum buffer size expressed in bytes.

Attributes

Remarks

Java documentation for android.media.AudioTrack.getMinBufferSize(int, int, int).

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