diff options
author | Joerg Mueller <nexyon@gmail.com> | 2010-10-31 17:44:45 +0300 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2010-10-31 17:44:45 +0300 |
commit | 4c80d13e54f5421774a992c1f1ff1c1ae832c2fc (patch) | |
tree | 6497b34d59431d823a61a52344b1319d07c2a744 | |
parent | 184b5fd6db4dfedb5c436ca1021bbe52df289a32 (diff) |
Audaspace: Disabling High- and Lowpass for Bake Sound to F-Curve Operator in case they're unused.
-rw-r--r-- | intern/audaspace/intern/AUD_C-API.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index 2e7309bf5c9..5e4e45d4e1e 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -782,10 +782,20 @@ float* AUD_readSoundBuffer(const char* filename, float low, float high, AUD_Sound* sound; AUD_FileFactory file(filename); + + AUD_IReader* reader = file.createReader(); + AUD_SampleRate rate = reader->getSpecs().rate; + delete reader; + AUD_ChannelMapperFactory mapper(&file, specs); - AUD_LowpassFactory lowpass(&mapper, high); - AUD_HighpassFactory highpass(&lowpass, low); - AUD_EnvelopeFactory envelope(&highpass, attack, release, threshold, 0.1f); + sound = &mapper; + AUD_LowpassFactory lowpass(sound, high); + if(high < rate) + sound = &lowpass; + AUD_HighpassFactory highpass(sound, low); + if(low > 0) + sound = &highpass; + AUD_EnvelopeFactory envelope(sound, attack, release, threshold, 0.1f); AUD_LinearResampleFactory resampler(&envelope, specs); sound = &resampler; AUD_SquareFactory squaref(sound, sthreshold); @@ -798,7 +808,7 @@ float* AUD_readSoundBuffer(const char* filename, float low, float high, else if(additive) sound = ∑ - AUD_IReader* reader = sound->createReader(); + reader = sound->createReader(); if(reader == NULL) return NULL; |