From 004683292faba35db93f2c4db4a9513fad12d728 Mon Sep 17 00:00:00 2001 From: Jules Fouchy Date: Fri, 3 Nov 2023 15:04:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20tests=20compilation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/tests.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/tests.cpp b/tests/tests.cpp index 83b629a..9fda4a8 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -21,13 +21,10 @@ auto main(int argc, char* argv[]) -> int ) { // Input stream - std::vector data_from_input_stream{}; - RtAudioW::InputStream input_stream{[&](std::span buffer) { - data_from_input_stream.assign(buffer.begin(), buffer.end()); - }, - [](RtAudioErrorType /* type */, std::string const& error_message) { - std::cerr << error_message << '\n'; - }}; + RtAudioW::InputStream input_stream{ + [](RtAudioErrorType /* type */, std::string const& error_message) { + std::cerr << error_message << '\n'; + }}; // Load the audio file Cool::load_audio_file(RtAudioW::player(), exe_path::dir() / "../../tests/res/Monteverdi - L'Orfeo, Toccata.mp3"); RtAudioW::player().play(); @@ -74,6 +71,10 @@ auto main(int argc, char* argv[]) -> int } ImGui::EndCombo(); } + auto data_from_input_stream = std::vector{}; + input_stream.for_each_sample(512, [&](float const sample) { + data_from_input_stream.push_back(sample); + }); ImGui::PlotHistogram( "Input Data", data_from_input_stream.data(),