I am using AudioRecord.read to capture PCM data to bytes. However, I found that it restricted to initialize the AudioRecord object with at least 3904 buffers. Where the sampling rate is 44100. Since I need to perform FFT of the data so I increased the samples to 4096. As a result, the callback runs every 40-60ms by setPositionNotificationPeriod to 500. Since a further decrease the duration doesn t make any changes. I m wondoring if it is the fastest callback time with below configuration?
取样率:44100
频道:莫诺
编码:PCM 16 BIT
Buffersize: 4096
(我每次阅读4096时,不能确定4096或2048年,只能填补20482个字节的缓冲)
even 40-60ms is acceptable, I then perform FFT which eventually block each callback around 200-300ms. And there is still many noise affecting the accuracy. I m using these source code: FFT in Java and Complex class
Is there any other choice that perform fast, reliable and consume less memory processing FFT? I found that the above classes new too much objects and pop up loads of gragarbage collection s messages.
最后,我有三个问题:
- Is the initial bufferSize equal to the buffers that I can read from the .read method?
- Is 40-60ms the limitation to capture audio data with 44100 sampling rate?
- Could you suggest some FFT library so that I can have a better performance in processing FFT? (I think if it is better to use C code library?)
感谢我的坏官,也感谢你在我的问题上花费时间。
P.S 我尝试了SOS,它只能采集512个样本,取样率为44100个。 因此,每次退约只剩下10个左右。