diff options
author | Ron Economos <w6rz@comcast.net> | 2020-09-23 21:13:12 -0700 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-09-25 06:19:11 -0400 |
commit | 8f3d61984ecd9ecc97789a174a54c7f0505bddb4 (patch) | |
tree | 994b9372e582a1f8f7e7ef91ccab524e3e0672b5 /gr-blocks/lib/wavfile_source_impl.h | |
parent | 1247d48d5416e0f62147f26907bd6c6f76fc2a31 (diff) |
gr-blocks: Fix wavfile sink and source block performance issues.
Calling libsndfile sf_read/write_float() for every sample created
too much overhead. sf_read/write_float() is now called every 1024
samples for the wavfile source block and every 8192 samples for
the wavfile sink block.
Diffstat (limited to 'gr-blocks/lib/wavfile_source_impl.h')
-rw-r--r-- | gr-blocks/lib/wavfile_source_impl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gr-blocks/lib/wavfile_source_impl.h b/gr-blocks/lib/wavfile_source_impl.h index 9554feab67..48a3b04f6a 100644 --- a/gr-blocks/lib/wavfile_source_impl.h +++ b/gr-blocks/lib/wavfile_source_impl.h @@ -26,6 +26,10 @@ private: wav_header_info d_h; long long d_sample_idx; + std::vector<float> d_buffer; + + static constexpr int s_items_size = 1024; + static constexpr int s_max_channels = 24; public: wavfile_source_impl(const char* filename, bool repeat); |