Record voice on Android

May 27, 2016
Changing Recording Settings

If you want to do a memo/dictaphone application then read on

if your trying to record a conversation, then its not possible at the time being at least (trust me I spend 1 month searching this with my colleagues).

so if you want to record your voice try this:

public class StreamerAudio implements Runnable { private static FileOutputStream fOut; public static boolean isRecording = false; private int buffersize; private static AudioRecord arec; private int encoding = AudioFormat.ENCODING_PCM_16BIT; private int audioChannel = AudioFormat.CHANNEL_CONFIGURATION_DEFAULT; private int audioSource = MediaRecorder.AudioSource.VOICE_DOWNLINK; private static MicProject parent = null; public StreamerAudio(MicProject parent_){ this.parent = parent_; } @Override public void run { //openFile; buffersize = (int) AudioRecord.getMinBufferSize(11025, audioChannel, AudioFormat.ENCODING_PCM_16BIT); arec = new AudioRecord(audioSource, 11025, audioChannel, encoding, buffersize); byte buffer = new byte[buffersize]; byte buffer2 = new byte[buffersize]; byte bufferSwap = buffer; arec.startRecording; isRecording = true; while(isRecording) { arec.read(buffer, 0, buffersize); printBuffer(buffer); } } public void printBuffer(byte buffer) { try { parent.setBufferToDisplay(buffer); } catch (Exception e) { }

YOU MIGHT ALSO LIKE
How to Record Sound on a Motorola Droid : Android Tips
How to Record Sound on a Motorola Droid : Android Tips
Testando Apk Voice Record | Espaco Android
Testando Apk Voice Record | Espaco Android
Automatically Record Your Phone Calls on Android [How-To]
Automatically Record Your Phone Calls on Android [How-To]
Share this Post