diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-09-26 01:14:31 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-09-26 01:14:31 +0200 |
commit | 73d4ae03e83cbfaacaf44d181b088fde8779b9c9 (patch) | |
tree | 3e7a9cf9957b4aafab758ee443c11cb26a9d82f3 | |
parent | 26166f45a412030549fca9fbeffedc7abad6a91b (diff) |
effects/builtin/echoeffect: Simplify timecast and use CSAMPLE_GAIN
-rw-r--r-- | src/effects/builtin/echoeffect.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/effects/builtin/echoeffect.cpp b/src/effects/builtin/echoeffect.cpp index e8d27cb457..fe1809b4ec 100644 --- a/src/effects/builtin/echoeffect.cpp +++ b/src/effects/builtin/echoeffect.cpp @@ -198,8 +198,8 @@ void EchoEffect::processChannel(const ChannelHandle& handle, EchoGroupState* pGr CSAMPLE bufferedSampleLeft = gs.delay_buf[read_position]; CSAMPLE bufferedSampleRight = gs.delay_buf[read_position + 1]; if (read_position != prev_read_position) { - const auto frac = static_cast<CSAMPLE_GAIN>(static_cast<double>(i) / - bufferParameters.samplesPerBuffer()); + const CSAMPLE_GAIN frac = static_cast<CSAMPLE_GAIN>(i) / + bufferParameters.samplesPerBuffer(); bufferedSampleLeft *= frac; bufferedSampleRight *= frac; bufferedSampleLeft += gs.delay_buf[prev_read_position] * (1 - frac); |