I found a lot of older posts using the following two lines to load in binary audio data:
MemoryInputStream* input = new MemoryInputStream (BinaryData::fille_wav, BinaryData::file_wav_size, false); auto reader = audioFormatManager.createReaderFor (input);
But that doesn’t seem to work anymore. Someone posted this solution that seemed to work for them:
std::unique_ptr<InputStream> stream = std::make_unique<MemoryInputStream>(fileData, true); AudioFormatReader* reader = m_FormatManager.createReaderFor(std::move(stream));
In my code, that looks like this:
std::unique_ptr<InputStream> stream = std::make_unique<MemoryInputStream>( BinaryData::clickSample_wav, BinaryData::clickSample_wavSize, false); AudioFormatReader* reader = mFormatManager.createReaderFor(std::move(stream));
But I get an error:
No matching member function for call to ‘createReaderFor’
std::move, I still get the same error.
Any ideas what might be causing that? Does binary data need to be handled differently? Android studio says that stream is
std::unique_ptr<InputStream>, which is what I intended it to be.