steelkiwi / AndroidRecording

Android Recording library offers convenient tools for audio/video recording and playback

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cracks in sound while recording

hollmannlu opened this issue · comments

hi, while recording audio, there appears to be some cracks/noise in your raw and wav-file (Nexus5, Android 4.4.4)... you could change buffersize to fix this like below:

in AudioRecordingThread:
audioBuffer = new byte[bufferSize * 2];
read = record.read(audioBuffer, 0, bufferSize * 2);
AudioRecord record = new AudioRecord(AudioSource.VOICE_RECOGNITION, //AudioSource.MIC
SAMPLING_RATE,
AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT,
bufferSize * 4);