mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 12:51:49 -05:00
AM modulator: pull a number of input audio samples depending on total interpolation. Fixes issue #43
This commit is contained in:
parent
f6bc9daf8e
commit
fdfa4351ad
@ -141,7 +141,7 @@ void AMMod::pull(Sample& sample)
|
||||
void AMMod::pullAudio(int nbSamples)
|
||||
{
|
||||
// qDebug("AMMod::pullAudio: %d", nbSamples);
|
||||
unsigned int nbAudioSamples = nbSamples * m_interpolatorDistance;
|
||||
unsigned int nbAudioSamples = nbSamples * ((Real) m_config.m_audioSampleRate / (Real) m_config.m_basebandSampleRate);
|
||||
|
||||
if (nbAudioSamples > m_audioBuffer.size())
|
||||
{
|
||||
@ -268,12 +268,14 @@ bool AMMod::handleMessage(const Message& cmd)
|
||||
{
|
||||
UpChannelizer::MsgChannelizerNotification& notif = (UpChannelizer::MsgChannelizerNotification&) cmd;
|
||||
|
||||
m_config.m_basebandSampleRate = notif.getBasebandSampleRate();
|
||||
m_config.m_outputSampleRate = notif.getSampleRate();
|
||||
m_config.m_inputFrequencyOffset = notif.getFrequencyOffset();
|
||||
|
||||
apply();
|
||||
|
||||
qDebug() << "AMMod::handleMessage: MsgChannelizerNotification:"
|
||||
<< " m_basebandSampleRate: " << m_config.m_basebandSampleRate
|
||||
<< " m_outputSampleRate: " << m_config.m_outputSampleRate
|
||||
<< " m_inputFrequencyOffset: " << m_config.m_inputFrequencyOffset;
|
||||
|
||||
|
@ -255,6 +255,7 @@ private:
|
||||
};
|
||||
|
||||
struct Config {
|
||||
int m_basebandSampleRate;
|
||||
int m_outputSampleRate;
|
||||
qint64 m_inputFrequencyOffset;
|
||||
Real m_rfBandwidth;
|
||||
@ -266,6 +267,7 @@ private:
|
||||
bool m_playLoop;
|
||||
|
||||
Config() :
|
||||
m_basebandSampleRate(0),
|
||||
m_outputSampleRate(-1),
|
||||
m_inputFrequencyOffset(0),
|
||||
m_rfBandwidth(-1),
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
const PluginDescriptor AMModPlugin::m_pluginDescriptor = {
|
||||
QString("AM Modulator"),
|
||||
QString("3.5.0"),
|
||||
QString("3.5.4"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
Loading…
Reference in New Issue
Block a user