Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Unified Diff: third_party/WebKit/Source/platform/audio/DynamicsCompressorKernel.cpp

Issue 2839063003: Implement tail processing for AudioNodes (Closed)
Patch Set: Make declaration order consistent Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/audio/DynamicsCompressorKernel.cpp
diff --git a/third_party/WebKit/Source/platform/audio/DynamicsCompressorKernel.cpp b/third_party/WebKit/Source/platform/audio/DynamicsCompressorKernel.cpp
index ce9bd1c0c503c1319fe13f7b614b2c921baa5324..59bbacdf70113111eca0be2f1501e44e5d74d806 100644
--- a/third_party/WebKit/Source/platform/audio/DynamicsCompressorKernel.cpp
+++ b/third_party/WebKit/Source/platform/audio/DynamicsCompressorKernel.cpp
@@ -495,4 +495,16 @@ void DynamicsCompressorKernel::Reset() {
max_attack_compression_diff_db_ = -1; // uninitialized state
}
+double DynamicsCompressorKernel::TailTime() const {
+ // The reduction value of the compressor is computed from the gain
+ // using an exponential filter with a time constant of
+ // |kMeteringReleaseTimeConstant|. We need to keep he compressor
+ // running for some time after the inputs go away so that the
+ // reduction value approaches 0. This is a tradeoff between how
+ // long we keep the node alive and how close we approach the final
+ // value. A value of 5 to 10 times the time constant is a
+ // reasonable trade-off.
+ return 5 * kMeteringReleaseTimeConstant;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698