From 1462890a77d7a9a7a7a34d4e50399d730b381db2 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Tue, 10 Dec 2024 10:45:48 +0000 Subject: [PATCH] Fix modulators when channel sample rate is greater than audio sample rate. --- plugins/channeltx/modam/ammodsource.cpp | 2 +- plugins/channeltx/modnfm/nfmmodsource.cpp | 2 +- plugins/channeltx/modssb/ssbmodsource.cpp | 2 +- plugins/channeltx/modwfm/wfmmodsource.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/channeltx/modam/ammodsource.cpp b/plugins/channeltx/modam/ammodsource.cpp index 602890269..165a2f426 100644 --- a/plugins/channeltx/modam/ammodsource.cpp +++ b/plugins/channeltx/modam/ammodsource.cpp @@ -128,7 +128,7 @@ void AMModSource::pullOne(Sample& sample) void AMModSource::prefetch(unsigned int nbSamples) { - auto nbSamplesAudio = (nbSamples * (unsigned int) ((Real) m_audioSampleRate / (Real) m_channelSampleRate)); + unsigned int nbSamplesAudio = (unsigned int) (nbSamples * ((Real) m_audioSampleRate / (Real) m_channelSampleRate)); pullAudio(nbSamplesAudio); } diff --git a/plugins/channeltx/modnfm/nfmmodsource.cpp b/plugins/channeltx/modnfm/nfmmodsource.cpp index ff37ccfb7..7d54cb13f 100644 --- a/plugins/channeltx/modnfm/nfmmodsource.cpp +++ b/plugins/channeltx/modnfm/nfmmodsource.cpp @@ -119,7 +119,7 @@ void NFMModSource::pullOne(Sample& sample) void NFMModSource::prefetch(unsigned int nbSamples) { - unsigned int nbSamplesAudio = (nbSamples * (unsigned int) ((Real) m_audioSampleRate / (Real) m_channelSampleRate)); + unsigned int nbSamplesAudio = (unsigned int) (nbSamples * ((Real) m_audioSampleRate / (Real) m_channelSampleRate)); pullAudio(nbSamplesAudio); } diff --git a/plugins/channeltx/modssb/ssbmodsource.cpp b/plugins/channeltx/modssb/ssbmodsource.cpp index c2e1f9df2..3d7e2483b 100644 --- a/plugins/channeltx/modssb/ssbmodsource.cpp +++ b/plugins/channeltx/modssb/ssbmodsource.cpp @@ -131,7 +131,7 @@ void SSBModSource::pullOne(Sample& sample) void SSBModSource::prefetch(unsigned int nbSamples) { - unsigned int nbSamplesAudio = (nbSamples * (unsigned int) ((Real) m_audioSampleRate / (Real) m_channelSampleRate)); + unsigned int nbSamplesAudio = (unsigned int) (nbSamples * ((Real) m_audioSampleRate / (Real) m_channelSampleRate)); pullAudio(nbSamplesAudio); } diff --git a/plugins/channeltx/modwfm/wfmmodsource.cpp b/plugins/channeltx/modwfm/wfmmodsource.cpp index 532ccf594..2b01569d4 100644 --- a/plugins/channeltx/modwfm/wfmmodsource.cpp +++ b/plugins/channeltx/modwfm/wfmmodsource.cpp @@ -191,7 +191,7 @@ void WFMModSource::modulateAudio() void WFMModSource::prefetch(unsigned int nbSamples) { - unsigned int nbSamplesAudio = nbSamples * ((Real) m_audioSampleRate / (Real) m_channelSampleRate); + unsigned int nbSamplesAudio = (unsigned int) (nbSamples * ((Real) m_audioSampleRate / (Real) m_channelSampleRate)); pullAudio(nbSamplesAudio); }