mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-25 12:07:49 +02:00
Mooooore performance
This commit is contained in:
@ -313,20 +313,14 @@ private:
|
||||
|
||||
static void _audioHandler(dsp::stereo_t *data, int count, void *ctx) {
|
||||
RecorderModule* _this = (RecorderModule*)ctx;
|
||||
for (int i = 0; i < count; i++) {
|
||||
_this->wavSampleBuf[(2*i)] = std::clamp<int>(data[i].l * 32767.0f, -32768, 32767);
|
||||
_this->wavSampleBuf[(2*i) + 1] = std::clamp<int>(data[i].r * 32767.0f, -32768, 32767);
|
||||
}
|
||||
volk_32f_s32f_convert_16i(_this->wavSampleBuf, (float*)data, 32767.0f, count*2);
|
||||
_this->audioWriter->writeSamples(_this->wavSampleBuf, count * 2 * sizeof(int16_t));
|
||||
_this->samplesWritten += count;
|
||||
}
|
||||
|
||||
static void _basebandHandler(dsp::complex_t *data, int count, void *ctx) {
|
||||
RecorderModule* _this = (RecorderModule*)ctx;
|
||||
for (int i = 0; i < count; i++) {
|
||||
_this->wavSampleBuf[(2*i)] = data[i].re * 32767.0f;
|
||||
_this->wavSampleBuf[(2*i) + 1] = data[i].im * 32767.0f;
|
||||
}
|
||||
volk_32f_s32f_convert_16i(_this->wavSampleBuf, (float*)data, 32767.0f, count*2);
|
||||
_this->basebandWriter->writeSamples(_this->wavSampleBuf, count * 2 * sizeof(int16_t));
|
||||
_this->samplesWritten += count;
|
||||
}
|
||||
|
Reference in New Issue
Block a user