我正在尝试在我的 android 应用程序中使用 Pure Data 来进行节拍检测。我之前有基本功能,但是在重构我的代码并扩展应用程序之后,libpd 无法正确创建所需的 AudioRecord 实例。以下是我得到的错误:
[ android.media.AudioTrack ] getMinBufferSize(): Invalid channel configuration.
[ android.media.AudioTrack ] getMinBufferSize(): Invalid channel configuration.
set(): sampleRate 44100, channels 12, frameCount 8832
Could not get audio input for record source 1
Error creating AudioRecord instance: initialization check failed.
[ android.media.AudioRecord ] Error code -20 when initializing native AudioRecord object.
java.io.IOException: unable to initialize AudioRecord instance for sr: 44100, ch: 2, bufSize: 4416
set(): sampleRate 44100, channels 16, frameCount 8832
Could not get audio input for record source 1
Error creating AudioRecord instance: initialization check failed.
[ android.media.AudioRecord ] Error code -20 when initializing native AudioRecord object.
java.io.IOException: unable to initialize AudioRecord instance for sr: 44100, ch: 1, bufSize: 4416
错误代码-20表示本机初始化失败,所以我现在不知道该怎么办。我的清单中确实有 RECORD_AUDIO 权限。你有什么建议吗?