Skip to content

Commit

Permalink
Merge pull request #2357 from srcejon/fix_2336
Browse files Browse the repository at this point in the history
Fix audio modulators when channel sample rate is greater than audio sample rate
  • Loading branch information
f4exb authored Dec 10, 2024
2 parents d696dd6 + 6812659 commit f4e2d10
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugins/channelrx/demodadsb/flags.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
<file>flags/kazakhstan_mil.bmp</file>
<file>flags/kenya.bmp</file>
<file>flags/kenya_mil.bmp</file>
<file>flags/khazakstan.bmp</file>
<file>flags/kazakhstan.bmp</file>
<file>flags/kiribati.bmp</file>
<file>flags/korea_north.bmp</file>
<file>flags/korea_north_mil.bmp</file>
Expand Down
2 changes: 1 addition & 1 deletion plugins/channelrx/demodadsb/flags/regprefixmap.csv
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ JA,japan
ZJ,jersey
JY,jordan
5Y,kenya
UP,khazakstan
UP,kazakhstan
T3,kiribati
P,korea_north
HL,korea-south
Expand Down
57 changes: 56 additions & 1 deletion plugins/channelrx/demoddsc/coaststations.cpp

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions plugins/channelrx/demoddsc/dscdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ void DSCDemodGUI::messageReceived(const DSCMessage& message, int errors, float r
if (CoastStations.contains(message.m_address)) {
addressNameItem->setText(CoastStations.value(message.m_address));
}
if (CoastStations.contains(message.m_selfId)) {
selfIdNameItem->setText(CoastStations.value(message.m_selfId));
}

// Get latest APRS.fi data to calculate distance
if (m_aprsFi && message.m_valid)
Expand Down
2 changes: 1 addition & 1 deletion plugins/channeltx/modam/ammodsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/channeltx/modnfm/nfmmodsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/channeltx/modssb/ssbmodsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/channeltx/modwfm/wfmmodsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit f4e2d10

Please sign in to comment.