| 348 | } |
| 349 | |
| 350 | bool 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 | |
| 374 | void SoundTouchBase::Finalize( |
| 375 | WaveTrack &orig, WaveTrack &out, const TimeWarper &warper) |
no test coverage detected