summaryrefslogtreecommitdiff
path: root/rotord/libavaudioloader.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/libavaudioloader.h')
-rw-r--r--rotord/libavaudioloader.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/rotord/libavaudioloader.h b/rotord/libavaudioloader.h
new file mode 100644
index 0000000..bacd6a9
--- /dev/null
+++ b/rotord/libavaudioloader.h
@@ -0,0 +1,45 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string>
+#include <math.h>
+#include <iostream>
+
+extern "C" {
+ #include <libavutil/mathematics.h>
+ #include <libavformat/avformat.h>
+ #include <libswscale/swscale.h>
+}
+
+namespace libav {
+
+ class audioloader{
+ public:
+ audioloader(){ready=false;sample_start=0;};
+ bool setup(const std::string &filename);
+ AVFrame* get_frame();
+ uint16_t* get_samples(int num){
+ if(!ready) return nullptr;
+ if (sample_start>0){
+
+ }
+ while (i<num) {
+ AVFrame *frame=get_frame();
+ if (frame==nullptr) return nullptr;
+ frame.nb_samples*
+
+ }
+ }
+ bool close();
+ bool ready;
+ private:
+ AVFrame* frame;
+ AVFormatContext* formatContext;
+ AVStream* audioStream;
+ AVCodecContext* codecContext;
+ AVPacket packet;
+ int sample_processed;
+ int sample_start;
+ };
+
+
+} \ No newline at end of file