我开发了一个通话录音应用程序,它在纯android设备上可以正常工作,但是它不能在小米和三星设备中录制其他人的声音,但是可以完美地录制我的声音,
这是我的代码
mediaRecorder = MediaRecorder()
mediaRecorder!!.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION)
mediaRecorder!!.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB)
mediaRecorder!!.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB)
val recordingFileName: String = getRandomRecordFileName(callType)
recordingFileNameForNotification = recordingFileName
mediaRecorder!!.setOutputFile(recordingFileName)
try {
mediaRecorder!!.prepare()
Log.i("CAL", "media prepared")
Log.i("CAL", "media record")
} catch (e: Exception) {
Log.i("CALL", "could'nt prepare")
//e.printStackTrace()
}
try {
mediaRecorder!!.start()
Log.i("CALL", "Recording Started")
isRecording = true
} catch (e: Exception) {
Log.i("CALL", "couldn't start recording")
}
我听说我需要使用ndk,但是不知道该怎么做 谁能帮我吗?