1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-27 02:09:14 -05:00

DSD decoder: push samples in scope if squelch open. Close audio if audio mute is on

This commit is contained in:
f4exb 2016-04-08 22:24:34 +02:00
parent 19317b1aa7
commit 3f92de1d53
2 changed files with 12 additions and 5 deletions

View File

@ -34,7 +34,6 @@ DSDDemod::DSDDemod(SampleSink* sampleSink) :
m_sampleCount(0),
m_squelchCount(0),
m_agcAttack(2400),
m_audioMute(false),
m_squelchOpen(false),
m_afSquelch(2, afSqTones),
m_audioFifo(4, 48000),
@ -138,7 +137,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
m_squelchOpen = m_squelchCount == m_agcAttack; // wait for AGC to stabilize
if ((m_squelchOpen) && !m_running.m_audioMute)
if (m_squelchOpen)
{
sample = demod;
}
@ -151,8 +150,17 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
m_scopeSampleBuffer.push_back(s);
m_dsdInBuffer[m_dsdInCount++] = sample;
if (m_running.m_audioMute)
{
m_audioBuffer[m_audioBufferFill].l = 0;
m_audioBuffer[m_audioBufferFill].r = 0;
}
else
{
m_audioBuffer[m_audioBufferFill].l = sample;
m_audioBuffer[m_audioBufferFill].r = sample;
}
++m_audioBufferFill;
if (m_audioBufferFill >= m_audioBuffer.size())

View File

@ -159,7 +159,6 @@ private:
int m_sampleCount;
int m_squelchCount;
int m_agcAttack;
bool m_audioMute;
double m_squelchLevel;
bool m_squelchOpen;