AudioRecord跳过几秒钟的数据

时间:2019-04-20 10:50:25

标签: android audio-recording pcm

我正在尝试使用AudioRecord类捕获音频数据,并且对于单声道录音工作正常,但是对于立体声模式,它会跳过随机位置的几秒钟数据。

  

就像录制10分钟一样,变成9分10秒。   此数据还用于MPEG-4 AAC编码

录制音频块:

minBufferSize = AudioRecord.getMinBufferSize(recordingSampleRate,
                AudioFormat.CHANNEL_IN_MONO,
                AudioFormat.ENCODING_PCM_16BIT);
recorder = new AudioRecord(
                MediaRecorder.AudioSource.MIC, recordingSampleRate,
                recordingChannels,
                AudioFormat.ENCODING_PCM_16BIT, minBufferSize*2);
recorder.startRecording()
  

我还尝试了minBufferSize = AudioRecord.getMinBufferSize(recordingSampleRate,                   recordChannels,                   AudioFormat.ENCODING_PCM_16BIT);

     

recordingChannel = AudioFormat.CHANNEL_IN_MONO或AudioFormat.CHANNEL_IN_STEREO

     

recordingSampleRate = 44100

0 个答案:

没有答案