JimDell
JimDell

Reputation: 1

Changing buffer size for certain amount of seconds

My question is that, given a buffer of int16_t buffer[128]; used to sample and play back an audio signal at 48kHz=Fs, how would I change the buffer size such that the buffers only store 0.25s of data.

Here's what I think, but I have no way of proving it given my hardware experience:

I'm not that knowledgeable about hardware, so any guidance/direction or help would be greatly appreciated. Thanks ahead of time!

Upvotes: 0

Views: 938

Answers (1)

ederwander
ederwander

Reputation: 3478

floor(25*48000/100)

ans =

       12000

So do you need int16_t buffer[12000] to get 0.25s of audio.

if you are doing something in real time a buffer of this size can cause undesired latency.

Upvotes: 1

Related Questions