You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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().
Steps To Reproduce Problem
Create any audio topology which uses AudioRecordQueue, where the input to the queue can be NULL audio blocks: a good candidate is AudioPlaySdWav. Without calling AudioPlaySdWav::begin(), call AudioRecordQueue::begin() and observe that AudioRecordQueue::available() never reports available (silent) data.
Hardware & Software
Teensy 4.1
Audio module
Arduino IDE version 1.8.15
Teensyduino version 1.54
Operating system & version not relevant
Arduino Sketch
#include<Audio.h>
#include<Wire.h>
#include<SPI.h>
#include<SD.h>
#include<SerialFlash.h>// GUItool: begin automatically generated code
AudioSynthWaveform waveform1; //xy=374,336
AudioOutputI2S i2s; //xy=566,356
AudioRecordQueue queue1; //xy=567,313
AudioConnection patchCord1(waveform1, 0, i2s, 0);
AudioConnection patchCord2(waveform1, queue1);
AudioControlSGTL5000 sgtl5000_1; //xy=558,398// GUItool: end automatically generated codevoidsetup() {
Serial.begin(115200);
while (!Serial)
;
AudioMemory(10);
}
voidloop() {
int n = 5;
queue1.begin(); // start monitoringdelay(10); // should get a few silent blocks
waveform1.begin(0.5f,261.0f,WAVEFORM_SINE);
while (n>0)
{
if (queue1.available())
{
int16_t* qd = queue1.readBuffer();
for (int i=0;i<128;i++)
Serial.println(qd[i]);
queue1.freeBuffer();
n--;
}
}
while (1)
;
}
Errors or Incorrect Output
should look like
The text was updated successfully, but these errors were encountered:
… with no input
record_queue.cpp - don't release() NULL or flag queue entries in ::clear(); allocate and blank a new audio block (if available) in ::readBuffer(), if we have a flag to say NULL (silence) was received; also keep returning same block until it's discarded by calling ::freeBuffer(); put flag in queue if record is activated by ::begin() but receiving only NULL pointers
record_queue.h - define the "silent data" flag pointer
Description
As in title, and discussed at https://forum.pjrc.com/threads/68000-AudioRecordQueue-behaves-incorrectly-with-no-input
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().
Steps To Reproduce Problem
Create any audio topology which uses AudioRecordQueue, where the input to the queue can be NULL audio blocks: a good candidate is AudioPlaySdWav. Without calling AudioPlaySdWav::begin(), call AudioRecordQueue::begin() and observe that AudioRecordQueue::available() never reports available (silent) data.
Hardware & Software
Teensy 4.1
Audio module
Arduino IDE version 1.8.15
Teensyduino version 1.54
Operating system & version not relevant
Arduino Sketch
Errors or Incorrect Output
should look like
The text was updated successfully, but these errors were encountered: