【问题标题】:MediaRecorder audio playback speedMediaRecorder 音频播放速度
【发布时间】:2018-02-14 21:35:21
【问题描述】:

我正在开发通话录音应用程序。我使用 MediaRecorder 来记录通话。录制文件的播放速度非常高看不懂。但是当我使用 KMPlayer 播放慢动作(30%-50% 速度)时,它可以清楚地理解。这仅在拨出电话时发生,并且仅在三星 Galaxy Core 2 中发生。下面是我的代码。

recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION);
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);

识别拨出电话的源代码如下,根据该调用startRecording()方法,其中包括上面的代码sn-p。

else if (intent.getAction().equals(ACTION_OUT)) {
   if ((bundle = intent.getExtras()) != null) {
      outCall = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
      absPath = startRecording("-OUT-");
        if ((bundle = intent.getExtras()) != null) {
        state = bundle.getString(TelephonyManager.EXTRA_STATE);
          if (state != null) {
             if (state.equals(TelephonyManager.EXTRA_STATE_IDLE)) {
                wasRinging = false;
                if (recordstarted) {
                   try{
                       recorder.stop();
                       recordstarted = false;
                       }catch (Exception e){
                         Log.e(TAG,"IOException",e);
                       }
                    }
                 }
              }
           }
        }
    }

任何解决方案都提前接受。

【问题讨论】:

    标签: android mediarecorder


    【解决方案1】:

    去掉这两行

    recorder.setAudioSamplingRate(8000);
    recorder.setAudioEncodingBitRate(12200);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-15
      • 1970-01-01
      • 2011-01-21
      • 1970-01-01
      相关资源
      最近更新 更多