diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-05-17 21:27:52 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-05-17 21:27:52 +0200 |
commit | 0e048dee411cc20beb2a8667e5bb339f9b7fb939 (patch) | |
tree | c9bacf6f2491f5ae6feb4f4786688ef5659f5c9b /src/audiofile.cc | |
parent | b6405171c6a74a5227555a9b75c03f88a5f21ed2 (diff) |
New resample feature on output channels.
Diffstat (limited to 'src/audiofile.cc')
-rw-r--r-- | src/audiofile.cc | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/audiofile.cc b/src/audiofile.cc index 874b9c5..59e0c14 100644 --- a/src/audiofile.cc +++ b/src/audiofile.cc @@ -34,9 +34,6 @@ #include <stdlib.h> #include <unistd.h> #include <sndfile.h> -#ifdef WITH_RESAMPLE -#include <samplerate.h> -#endif/*WITH_RESAMPLE*/ #include <hugin.hpp> #include "configuration.h" @@ -154,39 +151,6 @@ void AudioFile::load(int num_samples) sf_close(fh); -#ifdef WITH_RESAMPLE - - // Check environment to see if resample should be disabled. - // Defaults to "1" which is 'enable'. All other values are 'disabled'. - const char *env_res = getenv("DRUMGIZMO_RESAMPLE"); - if(env_res == NULL) env_res = "1"; - - if( (strcmp(env_res, "1") == 0) && - Conf::samplerate != sf_info.samplerate) { - // Resample data... - size_t osize = size * ratio; - sample_t *odata = new sample_t[osize]; - - SRC_DATA src; - src.data_in = data; - src.input_frames = size; - - src.data_out = odata; - src.output_frames = osize; - - src.src_ratio = ratio; - - // Do the conversion - src_simple(&src, SRC_SINC_BEST_QUALITY, 1); - - delete[] data; - data = odata; - size = src.output_frames; - - DEBUG(audiofile,"Converted into %d samples %p\n", (int)size, this); - } -#endif/*WITH_RESAMPLE*/ - this->data = data; is_loaded = true; |