Audioinfra
Member
Hi everyone, I want to used AudioPlayQueue and play the sound from AudioRecordQueue. When looking to the .cpp file, I found the different userblock queue size, I have an question to ask that will this different make the block transmission mismatch? and how much memory is enough in case I want to transfer 128 samples captured by AudioRecordQueue to AudioPLayQueue ? Sorry for the full code policy as I have no idea to start yet.
Code:
int16_t * AudioRecordQueue::readBuffer(void)
{
uint32_t t;
if (userblock) return NULL;
t = tail;
if (t == head) return NULL;
if (++t >= 53) t = 0;
userblock = queue[t];
tail = t;
return userblock->data;
}
Code:
void AudioPlayQueue::playBuffer(void)
{
uint32_t h;
if (!userblock) return;
h = head + 1;
if (h >= 32) h = 0;
while (tail == h) ; // wait until space in the queue
queue[h] = userblock;
head = h;
userblock = NULL;
}
Last edited: