Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2010-10-31 17:44:45 +0300
committerJoerg Mueller <nexyon@gmail.com>2010-10-31 17:44:45 +0300
commit4c80d13e54f5421774a992c1f1ff1c1ae832c2fc (patch)
tree6497b34d59431d823a61a52344b1319d07c2a744 /intern/audaspace
parent184b5fd6db4dfedb5c436ca1021bbe52df289a32 (diff)
Audaspace: Disabling High- and Lowpass for Bake Sound to F-Curve Operator in case they're unused.
Diffstat (limited to 'intern/audaspace')
-rw-r--r--intern/audaspace/intern/AUD_C-API.cpp18
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 = &sum;
- AUD_IReader* reader = sound->createReader();
+ reader = sound->createReader();
if(reader == NULL)
return NULL;