mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-04 16:01:14 -05:00
Copy audio to UDP/RTP: use audio filter frequency cutoff corresponding to decimation
This commit is contained in:
parent
6d4cb53eb6
commit
752e71c402
@ -27,6 +27,7 @@ AudioNetSink::AudioNetSink(QObject *parent) :
|
||||
m_type(SinkUDP),
|
||||
m_codec(CodecL16),
|
||||
m_rtpBufferAudio(0),
|
||||
m_sampleRate(48000),
|
||||
m_decimation(1),
|
||||
m_decimationCount(0),
|
||||
m_bufferIndex(0),
|
||||
@ -40,6 +41,7 @@ AudioNetSink::AudioNetSink(QObject *parent, int sampleRate, bool stereo) :
|
||||
m_type(SinkUDP),
|
||||
m_codec(CodecL16),
|
||||
m_rtpBufferAudio(0),
|
||||
m_sampleRate(48000),
|
||||
m_decimation(1),
|
||||
m_decimationCount(0),
|
||||
m_bufferIndex(0),
|
||||
@ -110,6 +112,8 @@ void AudioNetSink::setParameters(Codec codec, bool stereo, int sampleRate)
|
||||
<< " sampleRate: " << sampleRate;
|
||||
|
||||
m_codec = codec;
|
||||
m_sampleRate = sampleRate;
|
||||
m_audioFilter.setDecimFilters(m_sampleRate, m_decimation);
|
||||
|
||||
if (m_rtpBufferAudio)
|
||||
{
|
||||
@ -138,6 +142,7 @@ void AudioNetSink::setDecimation(uint32_t decimation)
|
||||
{
|
||||
m_decimation = decimation < 1 ? 1 : decimation > 6 ? 6 : decimation;
|
||||
qDebug() << "AudioNetSink::setDecimation: " << m_decimation << " from: " << decimation;
|
||||
m_audioFilter.setDecimFilters(m_sampleRate, m_decimation);
|
||||
m_decimationCount = 0;
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,7 @@ protected:
|
||||
RTPSink *m_rtpBufferAudio;
|
||||
AudioCompressor m_audioCompressor;
|
||||
AudioFilter m_audioFilter;
|
||||
int m_sampleRate;
|
||||
uint32_t m_decimation;
|
||||
uint32_t m_decimationCount;
|
||||
char m_data[65536];
|
||||
|
Loading…
Reference in New Issue
Block a user