Skip to content

Commit

Permalink
handle initial latency
Browse files Browse the repository at this point in the history
  • Loading branch information
Alzy committed Jan 28, 2025
1 parent 5476981 commit 8a0d138
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/BungeeAudioSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ inline void BungeeAudioSource::processNextBlock() {
const float* readPointer = outputChunk.data + channel * outputChunk.channelStride;
memcpy(writePointer, readPointer, outputChunk.frameCount * sizeof(float));
}
outputFifo->write(scratchBuffer, outputChunk.frameCount);

// Push to outputFifo content after negative (latency) region
if (outputChunk.request[Bungee::OutputChunk::begin]->position >= 0)
{
// we're pushing positions explicitly after negative region but a more robust solution <might> be necessary
outputFifo->write(scratchBuffer, outputChunk.frameCount);
}

stretcher->next(request);
Bungee::InputChunk inputChunk = stretcher->specifyGrain(request);
Expand Down

0 comments on commit 8a0d138

Please sign in to comment.