This commit is contained in:
Ryzerth
2020-11-02 16:16:21 +01:00
parent 75f8a45119
commit fc9bc496cb
6 changed files with 89 additions and 21 deletions

View File

@@ -96,16 +96,23 @@ namespace dsp {
}
int run() {
if constexpr (std::is_same_v<T, float>) { spdlog::warn("======= RESAMP WAITING ========"); }
count = _in->read();
if (count < 0) { return -1; }
if (count < 0) {
return -1;
}
int outCount = calcOutSize(count);
memcpy(bufStart, _in->data, count * sizeof(T));
_in->flush();
if constexpr (std::is_same_v<T, float>) { spdlog::warn("======= RESAMP GOT DATA ========"); }
// Write to output
if (out.aquire() < 0) { return -1; }
if (out.aquire() < 0) {
return -1;
}
int outIndex = 0;
if constexpr (std::is_same_v<T, float>) {
for (int i = 0; outIndex < outCount; i += _decim) {
@@ -129,6 +136,8 @@ namespace dsp {
}
out.write(count);
if constexpr (std::is_same_v<T, float>) { spdlog::warn("======= RESAMP WRITTEN ========"); }
memmove(buffer, &buffer[count], tapCount * sizeof(T));
return count;