#include #include #include #include #include #include extern "C" { #include #include #include } namespace libav { class Audioloader{ public: Audioloader(){ready=false;sample_start=0;sample_end=0;}; bool setup(const std::string &filename); AVFrame* get_frame(); uint16_t* get_samples(int num); bool close(); bool ready; private: std::vector buffer; AVFrame* frame; AVFormatContext* formatContext; AVStream* audioStream; AVCodecContext* codecContext; AVPacket packet; int sample_end; int sample_start; }; }