AudioRecord.GetMinBufferSize(Int32, ChannelIn, Encoding) Method

Definition

Returns the minimum buffer size required for the successful creation of an AudioRecord object, in byte units.

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

Parameters

sampleRateInHz
Int32

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

channelConfig
ChannelIn

describes the configuration of the audio channels. See AudioFormat#CHANNEL_IN_MONO and AudioFormat#CHANNEL_IN_STEREO

audioFormat
Encoding

the format in which the audio data is represented. See AudioFormat#ENCODING_PCM_16BIT.

Returns

#ERROR_BAD_VALUE if the recording parameters are not supported by the hardware, or an invalid parameter was passed, or #ERROR if the implementation was unable to query the hardware for its input properties, or the minimum buffer size expressed in bytes.

Attributes

Remarks

Returns the minimum buffer size required for the successful creation of an AudioRecord object, in byte units. Note that this size doesn't guarantee a smooth recording under load, and higher values should be chosen according to the expected frequency at which the AudioRecord instance will be polled for new data. See #AudioRecord(int, int, int, int, int) for more information on valid configuration values.

Java documentation for android.media.AudioRecord.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

See also

  • <xref:Android.Media.AudioRecord(Android.Media.AudioSource%2c+System.Int32%2c+System.Int32%2c+System.Int32%2c+System.Int32)>