blob: 42e6e2858694c3613d376e1d34ddd7caad1ed2db [file] [log] [blame]
<!doctype html>
<script src="resources/compatibility.js"></script>
<script src="resources/audio-testing.js"></script>
<script src="../resources/js-test.js"></script>
<script src="resources/panner-model-testing.js"></script>
<div id="description"></div>
<div id="console"></div>
description("Test equal-power panner model of AudioPannerNode with stereo source.");
// To test the panner, we create a number of panner nodes
// equally spaced on a semicircle at unit distance. The
// semicircle covers the azimuth range from -90 to 90 deg,
// covering full left to full right. Each source is an impulse
// turning at a different time and we check that the rendered
// impulse has the expected gain.
function runTest() {
if (window.testRunner) {
window.jsTestIsAsync = true;
// Create offline audio context.
context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
createTestAndRun(context, nodesToCreate, 2, function (panner, x, y, z) {
panner.positionX.value = x;
panner.positionY.value = y;
panner.positionZ.value = z;
successfullyParsed = true;