lundi 9 février 2015

android wear - audio capture failure

I was using the sample codes in http://ift.tt/1IiXn1x to capture the audio on the android wear. It works good on my handheld, but does not work on my smart watch. The error is: java.lang.RuntimeException: start failed The error happened in mRecorder.start(), see code segment below:



private void startRecording() {
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setOutputFile(mFileName);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

try {
mRecorder.prepare();
} catch (IOException e) {
Log.e(LOG_TAG, "prepare() failed");
}
mRecorder.start(); // error
}


What do I need to do? Thanks


Aucun commentaire:

Enregistrer un commentaire