MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / feedDecodedSpeech

Method feedDecodedSpeech

src/core/AudioEngine.cpp:6894–6913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6892}
6893
6894void AudioEngine::feedDecodedSpeech(const QByteArray& pcm)
6895{
6896 if (!m_audioSink || !m_audioDevice || !m_audioDevice->isOpen()) return;
6897
6898 // Decoded RADE speech goes into its own output-rate buffer. The drain
6899 // timer mixes it with m_rxOutputBuffer sample-wise so both are heard
6900 // simultaneously without doubling the fill rate. A dedicated resampler
6901 // preserves the filter state independently from the main RX output
6902 // resampler used by processMixedRxAudioData().
6903 if (m_rxOutputRate.load() != DEFAULT_SAMPLE_RATE) {
6904 if (!m_radeRxResampler)
6905 m_radeRxResampler = std::make_unique<Resampler>(24000, m_rxOutputRate.load());
6906 const auto* src = reinterpret_cast<const float*>(pcm.constData());
6907 m_radeRxBuffer.append(
6908 m_radeRxResampler->processStereoToStereo(
6909 src, pcm.size() / (2 * static_cast<int>(sizeof(float)))));
6910 } else {
6911 m_radeRxBuffer.append(pcm);
6912 }
6913}
6914
6915} // namespace AetherSDR

Callers

nothing calls this directly

Calls 4

processStereoToStereoMethod · 0.80
isOpenMethod · 0.45
loadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected