diff --git a/include/flucoma/clients/nrt/BufComposeClient.hpp b/include/flucoma/clients/nrt/BufComposeClient.hpp index 9546aee8..2b2c1561 100644 --- a/include/flucoma/clients/nrt/BufComposeClient.hpp +++ b/include/flucoma/clients/nrt/BufComposeClient.hpp @@ -81,6 +81,8 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut index nChannels{0}; index nFrames{0}; + double sourceSR; + { BufferAdaptor::ReadAccess source(get().get()); @@ -106,6 +108,8 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut if (get() >= source.numChans()) return {Result::Status::kError, "Start channel ", get(), " out of range."}; + + sourceSR = source.sampleRate(); } index dstStart = get(); @@ -161,7 +165,7 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut // Access sources inside own scope block, so they'll be unlocked before // we need to (possibly) resize the desintation buffer which could - // (possibly) also be one of the sources + // (possibly) also be one of the sources { BufferAdaptor::ReadAccess source(get().get()); auto gain = get(); @@ -199,7 +203,7 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut { Result resizeResult = destination.resize(destinationOrig.cols(), destinationOrig.rows(), - destination.sampleRate()); + sourceSR); if (!resizeResult.ok()) return resizeResult; for (index i = 0; i < destination.numChans(); ++i) destination.samps(i) <<= destinationOrig.row(i);