From 3c44012defec2ece54209251bf7970e46f9d091e Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 5 Jan 2015 21:41:48 +0000 Subject: [PATCH] Proposed fix for 1522 Noise at the end of Sample previews --- src/core/SamplePlayHandle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/SamplePlayHandle.cpp b/src/core/SamplePlayHandle.cpp index a881a5f8e..1bcf6691e 100644 --- a/src/core/SamplePlayHandle.cpp +++ b/src/core/SamplePlayHandle.cpp @@ -98,14 +98,15 @@ SamplePlayHandle::~SamplePlayHandle() void SamplePlayHandle::play( sampleFrame * buffer ) { + const fpp_t fpp = Engine::mixer()->framesPerPeriod(); //play( 0, _try_parallelizing ); if( framesDone() >= totalFrames() ) { + memset( buffer, 0, sizeof( sampleFrame ) * fpp ); return; } sampleFrame * workingBuffer = buffer; - const fpp_t fpp = Engine::mixer()->framesPerPeriod(); f_cnt_t frames = fpp; // apply offset for the first period