I want to turn on the MIC when app is run and store this sound temporary and after that send me the sound level in dp.is it possible to create this app.plese help me
thank you
I want to turn on the MIC when app is run and store this sound temporary and after that send me the sound level in dp.is it possible to create this app.plese help me
thank you
Please visit the following Recording tutorial
This part in particular:
String state = android.os.Environment.getExternalStorageState();
if(!state.equals(android.os.Environment.MEDIA_MOUNTED)) {
throw new IOException("SD Card is not mounted. It is " + state + ".");
}
// make sure the directory we plan to store the recording in exists
File directory = new File(path).getParentFile();
if (!directory.exists() && !directory.mkdirs()) {
throw new IOException("Path to file could not be created.");
}
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start();
Furthermore it is not strictly necessery to record a file to run an sound level check, as stated here