我正在使用音频录制器,但是无法确定错误出现的位置!应用程序崩溃了...
for (int rate : new int[]{8000, 11025, 16000, 22050, 44100}) {
mBufferSize = AudioRecord.getMinBufferSize(rate, AudioFormat
.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT);
}
mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,
RECORDER_SAMPLERATE,
RECORDER_CHANNELS,
RECORDER_AUDIO_ENCODING,
mBufferSize);
我查阅了Stack,但没有找到相关的答案... 堆栈跟踪:
01-05 18:25:19.863 21646-23485/com.voicy.demo A/AudioTrackShared: Assertion failed: !(stepCount <= mUnreleased && mUnreleased <= mFrameCount)
01-05 18:25:19.863 21646-23485/com.voicy.demo A/libc: Fatal signal 6 (SIGABRT) at 0x0000548e (code=-6), thread 23485 (AudioRecorder T)
01-05 18:25:20.333 1061-1107/? E/InputDispatcher: channel '424b68b0 com.voicy.demo/com.voicy.demo.ui.HomePageActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-05 18:25:20.333 1061-1107/? E/InputDispatcher: channel '42d324d0 com.voicy.demo/com.voicy.demo.ui.HomePageActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-05 18:25:20.333 1061-1107/? E/InputDispatcher: channel '424b3a60 com.voicy.demo/com.voicy.demo.ui.ChatMessageActivity (server)' ~ Channel is unrecoverably broken and will be disposed!