| 6892 | } |
| 6893 | |
| 6894 | void 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 |
nothing calls this directly
no test coverage detected