Why does the start() method of MediaRecorder throw an IllegalStateException?
问题 I am trying to record audio but the start() method of MediaRecorder class throws an IllegalStateException . I use the following code: MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile("/sdcard/"); try { recorder.prepare(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e