Skip to content

Commit

Permalink
Bug 1128494 - Change the default panning model of the PannerNode to "…
Browse files Browse the repository at this point in the history
…equalpower". r=smaug
  • Loading branch information
padenot committed Feb 3, 2015
1 parent dd818f0 commit 8671cd4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dom/media/webaudio/PannerNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PannerNodeEngine : public AudioNodeEngine
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.)
Expand Down Expand Up @@ -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.)
Expand Down
2 changes: 1 addition & 1 deletion dom/media/webaudio/test/test_pannerNode.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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");
Expand Down
2 changes: 2 additions & 0 deletions dom/media/webaudio/test/test_pannerNodeHRTFSymmetry.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
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);

Expand Down
2 changes: 2 additions & 0 deletions dom/media/webaudio/test/test_pannerNodeTail.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
delay.connect(referencePanner)

var panner = ctx.createPanner();
panner.type = "HRTF";
delay.connect(panner);
testPanners[i] = panner;

Expand Down Expand Up @@ -207,6 +208,7 @@
// 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);
Expand Down
8 changes: 4 additions & 4 deletions dom/webidl/PannerNode.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8671cd4

Please sign in to comment.