Reputation: 331
I'm writing an Android app, and I'm relying on processing the microphone signal. I'm getting the data with an AudioRecord object, on which I perform the read() function.
I am not exactly clear on the working of this function. Does it wait for the next BufferSize bytes and give them? Or does it just return the last BufferSize bytes from an internal buffer? I.e. if I call it twice in a short interval, will the data partially overlap?
Thank you!
Upvotes: 1
Views: 315
Reputation: 331
In the meantime, I have written code to find out the exact inner working. The read() function does actually just read the last BufferSize bytes from an internal buffer.
If you call the function in rapid succession, the returned data will almost completely overlap.
Upvotes: 1