From 55513473ca37841b40662e1a0221d7dd260a59b7 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 22 May 2013 19:39:11 +0100 Subject: baffled by audio analysis --- rotord/rendercontext.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'rotord/rendercontext.cpp') diff --git a/rotord/rendercontext.cpp b/rotord/rendercontext.cpp index 624b7c1..dec9f34 100644 --- a/rotord/rendercontext.cpp +++ b/rotord/rendercontext.cpp @@ -18,7 +18,7 @@ void Render_context::runTask() { for (auto a: analysers) { processors.push_back(dynamic_cast(a)); } - if (_load_audio(audio_filename,processors)) { + if (load_audio(audio_filename,processors)) { audio_loaded=true; state=IDLE; } @@ -268,6 +268,7 @@ Command_response Render_context::session_command(const std::vector& } return response; } +/* //http://blog.tomaka17.com/2012/03/libavcodeclibavformat-tutorial/ //great to use c++11 features @@ -289,7 +290,8 @@ bool Render_context::load_audio(const string &filename,vector processors){ +*/ +bool Render_context::load_audio(const string &filename,vector processors){ av_register_all(); @@ -358,10 +360,14 @@ bool Render_context::_load_audio(const string &filename,vectorduration)/AV_TIME_BASE; std::cout << "This stream has " << codecContext->channels << " channels, a sample rate of " << codecContext->sample_rate << "Hz and "<sample_fmt<< " (aka "<< av_get_sample_fmt_name(codecContext->sample_fmt) << ") "<sample_fmt<< " (aka "<< av_get_sample_fmt_name(codecContext->sample_fmt) << ")"<format<< " at "<sample_rate<<" Hz"<sample_rate=codecContext->sample_rate; + map params; for (auto p: processors) { - if(!p->init(codecContext->channels,16,samples,codecContext->sample_rate) ){ + if(!p->init(codecContext->channels,16,samples,codecContext->sample_rate,params) ){ cerr<<"Plugin failed to initialse"<cleanup(); + p->print_summary(); } -- cgit v1.2.3