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

Unified Diff: LayoutTests/webaudio/resources/panner-model-testing.js

Issue 652073003: Change the default panning mode from HRTF to equal-power (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
Patch Set: Created 6 years, 2 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: LayoutTests/webaudio/resources/panner-model-testing.js
diff --git a/LayoutTests/webaudio/resources/panner-model-testing.js b/LayoutTests/webaudio/resources/panner-model-testing.js
index f96857f8dd181410f17b33026eee231fee027133..6c853877b256b098dcc31e8c84028f88a6c6a60f 100644
--- a/LayoutTests/webaudio/resources/panner-model-testing.js
+++ b/LayoutTests/webaudio/resources/panner-model-testing.js
@@ -21,7 +21,7 @@ var bufferSource;
var panner;
var position;
var time;
-
+
var renderedBuffer;
var renderedLeft;
var renderedRight;
@@ -46,6 +46,8 @@ function createGraph(context, nodeCount) {
bufferSource[k].buffer = impulse;
panner[k] = context.createPanner();
+ // Equalpower is default now. May not be necessary.
+ // https://code.google.com/p/chromium/issues/detail?id=424356
panner[k].panningModel = "equalpower";
Raymond Toy 2014/10/17 17:39:30 I would just remove the comment and the assignment
hongchan 2014/10/17 18:13:41 Done.
panner[k].distanceModel = "linear";
@@ -92,17 +94,17 @@ function equalPowerGain(angle) {
} else {
if (azimuth <= 0) {
var panPosition = (azimuth + 90) / 90;
-
+
Raymond Toy 2014/10/17 17:39:30 Removing more blank lines?
hongchan 2014/10/17 18:13:41 Yes.
var gainL = 1 + Math.cos(0.5 * Math.PI * panPosition);
var gainR = Math.sin(0.5 * Math.PI * panPosition);
-
+
return { left : gainL, right : gainR };
} else {
var panPosition = azimuth / 90;
-
+
var gainL = Math.cos(0.5 * Math.PI * panPosition);
var gainR = 1 + Math.sin(0.5 * Math.PI * panPosition);
-
+
return { left : gainL, right : gainR };
}
}
@@ -117,7 +119,7 @@ function checkResult(event) {
// expected value. This value is experimentally determined. Set
// to 0 to make the test fail to see what the actual error is.
var maxAllowedError = 1.3e-6;
-
+
var success = true;
// Number of impulses found in the rendered result.
@@ -191,7 +193,7 @@ function checkResult(event) {
testFailed("Left channel gain values are incorrect. Max error = " + maxErrorL + " at time " + time[maxErrorIndexL] + " (threshold = " + maxAllowedError + ")");
success = false;
}
-
+
if (maxErrorR <= maxAllowedError) {
testPassed("Right channel gain values are correct.");
} else {

Powered by Google App Engine
This is Rietveld 408576698