小度创维机顶盒使用百度语音SDK
Ta的回复 :在Android8.0,9.0设备上运行良好,权限啥的肯定都声明好了。在盒子上有问题。检查麦克风未被占用,检查方法是:https://stackoverflow.com/questions/35633513/how-to-check-whether-microphone-is-used-by-any-background-app private boolean validateMicAvailability(){ Boolean available = true; AudioRecord recorder = new AudioRecord(MediaRecorder.AudioSource.MIC, 44100, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_DEFAULT, 44100); try{ if(recorder.getRecordingState() != AudioRecord.RECORDSTATE_STOPPED ){ available = false; } recorder.startRecording(); if(recorder.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING){ recorder.stop(); available = false; } recorder.stop(); } finally{ recorder.release(); recorder = null; } return available; } 请问这是啥原因