Bug 1128494 - Change the default panning model of the PannerNode to "equalpower". r=smaug

--HG--
extra : rebase_source : 34877a4b518ac354cf1732a16f70b1659986aabc
This commit is contained in:
Paul Adenot 2015-02-03 11:25:37 +01:00
parent 7b1576eed0
commit b40239c553
6 changed files with 12 additions and 8 deletions

View File

@ -486,7 +486,7 @@ const NODE_DEFAULT_VALUES = {
"oversample": "none"
},
"PannerNode": {
"panningModel": "HRTF",
"panningModel": "equalpower",
"distanceModel": "inverse",
"refDistance": 1,
"maxDistance": 10000,

View File

@ -45,7 +45,7 @@ public:
explicit PannerNodeEngine(AudioNode* aNode)
: AudioNodeEngine(aNode)
// Please keep these default values consistent with PannerNode::PannerNode below.
, mPanningModelFunction(&PannerNodeEngine::HRTFPanningFunction)
, mPanningModelFunction(&PannerNodeEngine::EqualPowerPanningFunction)
, mDistanceModelFunction(&PannerNodeEngine::InverseGainFunction)
, mPosition()
, mOrientation(1., 0., 0.)
@ -228,7 +228,7 @@ PannerNode::PannerNode(AudioContext* aContext)
ChannelCountMode::Clamped_max,
ChannelInterpretation::Speakers)
// Please keep these default values consistent with PannerNodeEngine::PannerNodeEngine above.
, mPanningModel(PanningModelType::HRTF)
, mPanningModel(PanningModelType::Equalpower)
, mDistanceModel(DistanceModelType::Inverse)
, mPosition()
, mOrientation(1., 0., 0.)

View File

@ -33,7 +33,7 @@ addLoadEvent(function() {
panner.connect(destination);
// Verify default values
is(panner.panningModel, "HRTF", "Correct default value for panning model");
is(panner.panningModel, "equalpower", "Correct default value for panning model");
is(panner.distanceModel, "inverse", "Correct default value for distance model");
near(panner.refDistance, 1, "Correct default value for ref distance");
near(panner.maxDistance, 10000, "Correct default value for max distance");

View File

@ -29,6 +29,8 @@ function isChannelSilent(channel) {
function startTest() {
var leftPanner = ctx.createPanner();
var rightPanner = ctx.createPanner();
leftPanner.type = "HRTF";
rightPanner.type = "HRTF";
leftPanner.setPosition(-1,0,0);
rightPanner.setPosition(1,0,0);

View File

@ -176,6 +176,7 @@ function startTest() {
delay.connect(referencePanner)
var panner = ctx.createPanner();
panner.type = "HRTF";
delay.connect(panner);
testPanners[i] = panner;
@ -207,6 +208,7 @@ function prepareTest() {
// database. Wait for this to load before starting the test.
var processor = ctx.createScriptProcessor(bufferSize, 2, 0);
referencePanner = ctx.createPanner();
referencePanner.type = "HRTF";
referencePanner.connect(processor);
var oscillator = ctx.createOscillator();
oscillator.connect(referencePanner);

View File

@ -23,21 +23,21 @@ enum DistanceModelType {
interface PannerNode : AudioNode {
// Default for stereo is HRTF
// Default for stereo is equalpower
attribute PanningModelType panningModel;
// Uses a 3D cartesian coordinate system
// Uses a 3D cartesian coordinate system
void setPosition(double x, double y, double z);
void setOrientation(double x, double y, double z);
void setVelocity(double x, double y, double z);
// Distance model and attributes
// Distance model and attributes
attribute DistanceModelType distanceModel;
attribute double refDistance;
attribute double maxDistance;
attribute double rolloffFactor;
// Directional sound cone
// Directional sound cone
attribute double coneInnerAngle;
attribute double coneOuterAngle;
attribute double coneOuterGain;