blob: 80d4ae39249b20b102caa270adaf6575e41204a3 [file] [log] [blame]
<!doctype html>
<html>
<head>
<title>Test Oscillator Node: sawtooth</title>
<script src="../resources/js-test.js"></script>
<script src="resources/compatibility.js"></script>
<script src="resources/buffer-loader.js"></script>
<script src="resources/oscillator-testing.js"></script>
</head>
<body>
<script>
description("Test Builtin Oscillator PeriodicWave Tables");
// Create an offline context with a sample rate that is very different from the sample rate
// used in the OscillatorTestingUtils. This will create a internal PeriodicWave objects for
// the Oscillator. This should not interfere with the oscillator test using a different
// context with a different sample rate.
var context = new OfflineAudioContext(1, 1, 3000);
var osc = context.createOscillator();
osc.type = "sawtooth";
osc = null;
// This test is identical to the test in osc-sawtooth-sweep-snr.html.
var tester = OscillatorTestingUtils;
// The thresholds are experimentally determined.
tester.setThresholds({snr: 80.00, maxDiff: 4.06, diffCount: 15827});
tester.runTest("sawtooth");
successfullyParsed = true;
</script>
</body>
</html>