Here's some code (quickly adapted from fingerprint generation in foo_sic, so it might not compile right away):
bool void g_decode_file(char const * p_path, abort_callback & p_abort)
{
try
{
input_helper helper;
file_info_impl info;
// open input
helper.open(service_ptr_t<file>(), make_playable_location(p_path, 0), input_flag_simpledecode, p_abort);
helper.get_info(0, info, p_abort);
if (info.get_length() <= 0)
throw pfc::exception("Track length invalid");
audio_chunk_impl chunk;
if (!helper.run(chunk, p_abort)) return false;
t_uint64 length_samples = audio_math::time_to_samples(info.get_length(), chunk.get_sample_rate());
//chunk.get_channels();
while (true)
{
// Store the data somewhere.
bool decode_done = !helper.run(chunk, p_abort);
if (decode_done) break;
}
// We now have the full data.
return true;
}
catch (const exception_aborted &) {throw;}
catch (const std::exception & exc)
{
console::formatter() << exc << ": " << p_path;
return false;
}
};