Skip to content

Commit

Permalink
assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Licameli committed Oct 13, 2023
1 parent b3745f4 commit 854b8f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/lib-stretching-sequence/StretchingSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ bool StretchingSequence::GetNext(
mActiveAudioSegmentIt != mAudioSegments.end())
{
const auto& segment = *mActiveAudioSegmentIt;
// More-than-stereo isn't supported
assert(mSequence.NChannels() <= 2);
float *offsetBuffers[2]{};
GetOffsetBuffer(offsetBuffers,
buffers, mSequence.NChannels(), numProcessedSamples);
Expand All @@ -67,6 +69,8 @@ bool StretchingSequence::GetNext(
const auto remaining = numSamples - numProcessedSamples;
if (remaining > 0u)
{
// More-than-stereo isn't supported
assert(mSequence.NChannels() <= 2);
float *offsetBuffers[2]{};
GetOffsetBuffer(
offsetBuffers, buffers, mSequence.NChannels(), numProcessedSamples);
Expand Down
2 changes: 2 additions & 0 deletions libraries/lib-time-and-pitch/StaffPadTimeAndPitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ void StaffPadTimeAndPitch::GetSamples(float* const* output, size_t outputLen)
const auto numSamplesToGet =
std::min({ maxBlockSize, numOutputSamplesAvailable,
static_cast<int>(outputLen - numOutputSamples) });
// More-than-stereo isn't supported
assert(mNumChannels <= 2);
float *buffer[2]{};
GetOffsetBuffer(buffer, output, mNumChannels, numOutputSamples);
mTimeAndPitch->retrieveAudio(buffer, numSamplesToGet);
Expand Down

0 comments on commit 854b8f3

Please sign in to comment.