我是一名有用的助手,可以为您翻译以下内容。涉及IT技术方面的问题,您需要将命令行工具构建到Android NDK中,并在/data/local/tmp中执行。现在它提示我“需要android.permission.RECORD_AUDIO权限”。这通常在Java应用程序的AndroidManifest.xml文件中设置,但如何授予给Android shell用户呢?
源代码如下:
sp<AudioRecord> rec = new AudioRecord(AUDIO_SOURCE_MIC, 44100, AUDIO_FORMAT_PCM_16_BIT, AUDIO_CHANNEL_IN_MONO);
日志记录:
I/AudioFlinger( 3772): AudioFlinger's thread 0xf0e838c0 ready to run
W/ServiceManager( 3772): Permission failure:android.permission.RECORD_AUDIO from uid=2000 pid=-1
E/ ( 3772): Request requires android.permission.RECORD_AUDIO
E/AudioFlinger( 3772): openRecord() permission denied: recording not allowed
E/AudioRecord(14132): AudioFlinger could not create record track, status: -1
--------- beginning of crash
...