try this code
int audioSource = MediaRecorder.AudioSource.VOICE_DOWNLINK; int sampleRateInHz = 8000; int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO; int audioFormat = AudioFormat.ENCODING_PCM_16BIT; bufferSize = AudioRecord.getMinBufferSize(sampleRateInHz, channelConfig, audioFormat); AudioRecord recordInstance = new AudioRecord(audioSource, sampleRateInHz, channelConfig, audioFormat, bufferSize); recordInstance.startRecording();
source share