我尝试使用AudioRecord对象录制语音 除了Galaxy S6 edge之外,它在所有设备上都能很好地工作 这里是代码
AudioRecord recorder = null;
int desiredRate = 0;
for (int rate : new int[] {44100, 8000, 11025, 16000, 22050}) {
int bufferSize = AudioRecord.getMinBufferSize(rate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT);
if (bufferSize > 0) {
// buffer size is valid, Sample rate supported
recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, rate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);
if (recorder.getState() != AudioRecord.STATE_INITIALIZED) {
recorder.release();
} else {
break;
}
}
}
在银河系中,州为0 可能是什么原因?