I am doing recording in following way and storing byte array in a
binary file. But the binary file I am getting is not in any format.
what can be the problem?


int bufferSize = AudioRecord.getMinBufferSize(8000,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT);
                        byte[] tempBuffer = new byte[bufferSize];
                        AudioRecord recorder = new
AudioRecord(MediaRecorder.AudioSource.MIC, 8000,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT,bufferSize*4);
                        recorder.startRecording();
                        bufferRead = recorder.read(tempBuffer, 0, bufferSize);
                        FileOutputStream fos = new FileOutputStream(new 
File("sdcard/
output.bi"));
                        OutputStreamWriter osw = new OutputStreamWriter(fos);
                        for (int idxBuffer = 0; idxBuffer < bufferRead; 
++idxBuffer) {
                                        osw.write(tempBuffer[idxBuffer]);
                        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to