h4yn0nnym0u5e
Well-known member
The Audio library design rules state that a NULL received audio block (from receiveReadOnly()) should be treated as if a silent block had been received. AudioRecordQueue does not do this, but simply fails to count or queue the NULL, even when it has been enabled by queue.begin(). There seem to be three possible fixes:
Cheers
Jonathan
- queue the NULL, and change the API documentation to state that if AudioRecordQueue::available() reports a non-zero number, then when AudioRecordQueue::readBuffer() returns NULL this should be interpreted as a silent block: AudioRecordQueue::freeBuffer() can still safely be called, and the behaviour will be consistent
- queue a "flag" value, e.g. 1 (invalid but non-zero "pointer"); interpret AudioRecordQueue::readBuffer() == 1 as silent block; modify AudioRecordQueue::freeBuffer() so it does not attempt to release() the invalid block pointer
- allocate and zero out an audio block from the pool, and queue that as normal
Cheers
Jonathan