在安卓自带的录音软件上录音没问题,但是在客户提供的student.apk上麦克风录音有噪点,怀疑是录音缓冲过低,有缓冲溢出,下面通过增大period_size和period_count的值从而增大音频缓冲,从而解决了麦克风录音有噪点的问题。
--- a/hardware/rockchip/audio/tinyalsa_hal/audio_hw.h
+++ b/hardware/rockchip/audio/tinyalsa_hal/audio_hw.h
@@ -151,11 +151,11 @@ struct pcm_config pcm_config_in = {
.channels = 2,
.rate = 44100,
#ifdef RK_DENOISE_ENABLE
- .period_size = 441,
+ .period_size = 600,
#else
- .period_size = 256,
+ .period_size = 600,
#endif
- .period_count = 4,
+ .period_count = 8,
.format = PCM_FORMAT_S16_LE,
};
#endif