Commit a5ab21cc authored by hongchan@chromium.org's avatar hongchan@chromium.org

The HRTF panner uses significant memory for the responses and requires a fair...

The HRTF panner uses significant memory for the responses and requires a fair amount of processing to implement. For low-end mobile devices, this can be an issue. Since the default panner model is HRTF, the creation of the panner can cause the responses to be loaded.

Perhaps the default should be changed to equalpower, which doesn't consume significant memory and is much less intensive in processing power.

This is an incompatible change with the current spec.

See also: https://github.com/WebAudio/web-audio-api/issues/368

BUG=424356

Review URL: https://codereview.chromium.org/652073003

git-svn-id: svn://svn.chromium.org/blink/trunk@183925 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 070971c1
...@@ -16,7 +16,7 @@ PASS coneOuterAngle default value is 360. ...@@ -16,7 +16,7 @@ PASS coneOuterAngle default value is 360.
PASS coneOuterAngle value is set to 166.66. PASS coneOuterAngle value is set to 166.66.
PASS coneOuterGain default value is 0. PASS coneOuterGain default value is 0.
PASS coneOuterGain value is set to 0.35. PASS coneOuterGain value is set to 0.35.
PASS PannerNode defaults to 'HRTF' panningModel. PASS PannerNode defaults to 'equalpower' panningModel.
PASS PannerNode defaults to 'inverse' distanceModel. PASS PannerNode defaults to 'inverse' distanceModel.
PASS panningModel: 'equalpower' is settable. PASS panningModel: 'equalpower' is settable.
PASS panningModel: 'HRTF' is settable. PASS panningModel: 'HRTF' is settable.
......
...@@ -102,10 +102,10 @@ function runTest() { ...@@ -102,10 +102,10 @@ function runTest() {
else else
testFailed("coneOuterGain value should be set to 0.35."); testFailed("coneOuterGain value should be set to 0.35.");
if (panner.panningModel === "HRTF") if (panner.panningModel === "equalpower")
testPassed("PannerNode defaults to 'HRTF' panningModel."); testPassed("PannerNode defaults to 'equalpower' panningModel.");
else else
testFailed("PannerNode should default to 'HRTF' panningModel."); testFailed("PannerNode should default to 'equalpower' panningModel.");
if (panner.distanceModel === "inverse") if (panner.distanceModel === "inverse")
testPassed("PannerNode defaults to 'inverse' distanceModel."); testPassed("PannerNode defaults to 'inverse' distanceModel.");
......
...@@ -48,7 +48,7 @@ static void fixNANs(double &x) ...@@ -48,7 +48,7 @@ static void fixNANs(double &x)
PannerNode::PannerNode(AudioContext* context, float sampleRate) PannerNode::PannerNode(AudioContext* context, float sampleRate)
: AudioNode(context, sampleRate) : AudioNode(context, sampleRate)
, m_panningModel(Panner::PanningModelHRTF) , m_panningModel(Panner::PanningModelEqualPower)
, m_distanceModel(DistanceEffect::ModelInverse) , m_distanceModel(DistanceEffect::ModelInverse)
, m_position(0, 0, 0) , m_position(0, 0, 0)
, m_orientation(1, 0, 0) , m_orientation(1, 0, 0)
...@@ -198,7 +198,7 @@ String PannerNode::panningModel() const ...@@ -198,7 +198,7 @@ String PannerNode::panningModel() const
return "HRTF"; return "HRTF";
default: default:
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
return "HRTF"; return "equalpower";
} }
} }
......
...@@ -37,7 +37,7 @@ enum DistanceModelType { ...@@ -37,7 +37,7 @@ enum DistanceModelType {
NoInterfaceObject, NoInterfaceObject,
Conditional=WEB_AUDIO Conditional=WEB_AUDIO
] interface PannerNode : AudioNode { ] interface PannerNode : AudioNode {
// Default model for stereo is HRTF // Default model for stereo is equalpower.
attribute PanningModelType panningModel; attribute PanningModelType panningModel;
// Uses a 3D cartesian coordinate system // Uses a 3D cartesian coordinate system
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment