diff options
| -rw-r--r-- | rotord/rendercontext.cpp | 13 | ||||
| -rwxr-xr-x | rotord/rotor.cpp | 2 | ||||
| -rwxr-xr-x | rotord/rotor.h | 3 |
3 files changed, 16 insertions, 2 deletions
diff --git a/rotord/rendercontext.cpp b/rotord/rendercontext.cpp index d0fa5bd..cdb1cf7 100644 --- a/rotord/rendercontext.cpp +++ b/rotord/rendercontext.cpp @@ -271,8 +271,19 @@ Command_response Render_context::session_command(const std::vector<std::string>& //http://blog.tomaka17.com/2012/03/libavcodeclibavformat-tutorial/ //great to use c++11 features - bool Render_context::load_audio(const string &filename,vector<Base_audio_processor*> processors){ + audioloader.setup(filename); + + for (auto p: processors) { + if(!p->init(codecContext->channels,16,samples,codecContext->sample_rate) ){ + cerr<<"Plugin failed to initialse"<<endl; + return false; + } + } + + return true; +} +bool Render_context::_load_audio(const string &filename,vector<Base_audio_processor*> processors){ av_register_all(); diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp index 4c79fc1..46bc9c9 100755 --- a/rotord/rotor.cpp +++ b/rotord/rotor.cpp @@ -76,7 +76,7 @@ int Audio_thumbnailer::process_frame(uint8_t *_data,int samples_in_frame){ for (int i=0;i<channels;i++) { unsigned int this_val=0; for (int j=0;j<bytes;j++) { - this_val+=_data[(in_sample*stride)+(i*bytes)+j]<<(j*8); +// this_val+=_data[(in_sample*stride)+(i*bytes)+j]<<(j*8); } //convert from integer data format - i.e s16p - to audio signal in -1..1 range //presume 16 bits for now... diff --git a/rotord/rotor.h b/rotord/rotor.h index ea4d758..5b92199 100755 --- a/rotord/rotor.h +++ b/rotord/rotor.h @@ -574,6 +574,7 @@ namespace Rotor { void cancel(); //interrupt locking process int make_preview(int nodeID, float time); //starts a frame preview - returns status code - how to retrieve? bool load_audio(const string &filename,vector<Base_audio_processor*> processors); + bool _load_audio(const string &filename,vector<Base_audio_processor*> processors); Render_requirements get_requirements(); bool load_video(const string &nodeID,const string &filename);//can be performance or clip private: @@ -591,6 +592,8 @@ namespace Rotor { Node_factory factory; float output_framerate; bool audio_loaded; + + libav::Audioloader audioloader; }; } |
