android2.2和2.3录音失败.
以下代码在2.1中没有问题,
private void startRecord(Context context, Intent intent){ String path = intent.getStringExtra(AndrecorderContactHelper.FILEPATH); recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL); // String _type = AndrecorderConfiguration.getConfiguration(context).getRecordType(); int format = OutputFormat.DEFAULT; if (_type.equalsIgnoreCase("amr")) format = OutputFormat.RAW_AMR; else if (_type.equalsIgnoreCase("3gp")) format = OutputFormat.THREE_GPP; else if (_type.equalsIgnoreCase("mp4")) format = OutputFormat.MPEG_4; recorder.setOutputFormat(format); recorder.setAudioEncoder(AAC); recorder.setOutputFile(path); try { recorder.prepare(); recorder.start(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } // Log.i("whut", "开始录音"); recording = true; }