0
votes

I need to record 10 seconds of audio and than to perform convolution with some other signal. I need to record audio with sampling rate of 512hz. As my phone(i guess it's hard that any phone supports sample rate of 512hz) doesn't support that sampling rate, i need to record audio in higher sampling rate and than downsample to 512hz. For recording audio I use AudioRecord and the only frequency that is guaranteed to work is 44100hz. Every lib or code that i found perform downsampling by reading and writing to file. As i need it to be very fast, i need to perform this action couple times in one second(at least two), is any way to perform dowsampling on raw PCM data written in byte array and to be very fast?

1

1 Answers

0
votes

Any reason you are aiming for a sample rate of 512hz? Seems a bit low to be useful!

I am not sure what language you are using but I use libsoxr within C++. A quick google comes up with libresample4j for java. Both these will let you do the resampling in real time, without have to save a file first.