Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Oct 30, 2024
1 parent 397b303 commit ad5ba68
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/src/node/io/input/miniaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ void AudioIn::init()
for (int channel = 0; channel < device.capture.internalChannels; channel++)
{
SampleRingQueue *queue = new SampleRingQueue(device.capture.internalPeriodSizeInFrames * 8);
/*--------------------------------------------------------------------------------
* Initialise the queue with single block of silence, ensuring that the write
* head is always ahead of the read head by a block. This adds a single block
* of latency between input and output, but buffers against jitter in the
* case that two reads occur between one write (as experienced on Linux/alsa).
*-------------------------------------------------------------------------------*/
std::vector<float> silence(device.capture.internalPeriodSizeInFrames, 0);
queue->extend(silence);
input_queue.push_back(queue);
Expand Down

0 comments on commit ad5ba68

Please sign in to comment.