Skip to content

Commit

Permalink
Revert "Add delays to make sure we don't process audio too quickly."
Browse files Browse the repository at this point in the history
This reverts commit 6f0c6eb.
  • Loading branch information
tmiw committed Sep 4, 2024
1 parent 6f0c6eb commit c034aba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/pipeline/ExternVocoderStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,15 @@ int ExternVocoderStep::getOutputSampleRate() const

std::shared_ptr<short> ExternVocoderStep::execute(std::shared_ptr<short> inputSamples, int numInputSamples, int* numOutputSamples)
{
const int MAX_OUTPUT_SAMPLES = 1024;

*numOutputSamples = 0;
short* outputSamples = nullptr;

// Write input samples to thread for processing
if (numInputSamples > 0)
{
codec2_fifo_write(inputSampleFifo_, inputSamples.get(), numInputSamples);
#ifdef _WIN32
// XXX: simulate required processing time as actual I/O is handled
// by another thread. For some reason this is only needed on Windows.
int timeToSleep = (numInputSamples * 1000 / getInputSampleRate()) >> 2;
if (timeToSleep > 0) Sleep(timeToSleep);
#endif // _WIN32
}

// Read and return output samples from thread.
Expand Down

0 comments on commit c034aba

Please sign in to comment.