Android examples for android.media:Audio
get Buffer Size from AudioRecord
import android.media.AudioFormat; import android.media.AudioRecord; public class Main{ public static int getBufferSize(int sampleRateInHz, int channelConfig, int audioFormat) { int bufferSize = AudioRecord.getMinBufferSize(sampleRateInHz, channelConfig, audioFormat); if (bufferSize < sampleRateInHz) { bufferSize = sampleRateInHz; }//www .ja v a 2s. c o m return bufferSize; } }