MCPcopy Create free account
hub / github.com/audacity/audacity / ProcessStereoResults

Method ProcessStereoResults

libraries/lib-builtin-effects/SoundTouchBase.cpp:350–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350bool SoundTouchBase::ProcessStereoResults(soundtouch::SoundTouch *pSoundTouch,
351 const size_t outputCount,
352 WaveChannel &outputLeftTrack,
353 WaveChannel &outputRightTrack)
354{
355 Floats outputSoundTouchBuffer{ outputCount * 2 };
356 pSoundTouch->receiveSamples(outputSoundTouchBuffer.get(), outputCount);
357
358 // Dis-interleave outputSoundTouchBuffer into separate track buffers.
359 Floats outputLeftBuffer{ outputCount };
360 Floats outputRightBuffer{ outputCount };
361 for (unsigned int index = 0; index < outputCount; ++index) {
362 outputLeftBuffer[index] = outputSoundTouchBuffer[index * 2];
363 outputRightBuffer[index] = outputSoundTouchBuffer[(index * 2) + 1];
364 }
365
366 outputLeftTrack.Append(
367 (samplePtr)outputLeftBuffer.get(), floatSample, outputCount);
368 outputRightTrack.Append(
369 (samplePtr)outputRightBuffer.get(), floatSample, outputCount);
370
371 return true;
372}
373
374void SoundTouchBase::Finalize(
375 WaveTrack &orig, WaveTrack &out, const TimeWarper &warper)

Callers 1

ProcessStereoMethod · 0.95

Calls 3

receiveSamplesMethod · 0.45
getMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected