Skip to content

Commit

Permalink
Scale number of output samples based on input/output sample rates.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiw committed Sep 4, 2024
1 parent 6a2f9ce commit a23f62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pipeline/ExternVocoderStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ std::shared_ptr<short> ExternVocoderStep::execute(std::shared_ptr<short> inputSa

// Read and return output samples from thread.
*numOutputSamples = codec2_fifo_used(outputSampleFifo_);
*numOutputSamples = std::min(*numOutputSamples, MAX_OUTPUT_SAMPLES);
*numOutputSamples = std::min(*numOutputSamples, numInputSamples * getOutputSampleRate() / getInputSampleRate());
if (*numOutputSamples > 0)
{
outputSamples = new short[*numOutputSamples];
Expand Down

0 comments on commit a23f62e

Please sign in to comment.