English 中文(简体)
中文实时录音处理
原标题:Real time audio processing in Android

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.

最后,我有三个问题:

  1. Is the initial bufferSize equal to the buffers that I can read from the .read method?
  2. Is 40-60ms the limitation to capture audio data with 44100 sampling rate?
  3. 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个左右。

问题回答

Regarding question #3: Maybe not as fast as a native library, but I ve started using these classes, and they seem to be fine for real-time work (although I am reading from files, not the microphone): FFTPack.

最常见的土著图书馆是KissFFT, 您可以找到汇编成文,作为libGDX





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签