bug 1339889 don't use AnalyserNode smoothing when testing signal r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Sat, 02 Dec 2017 22:09:10 +1300
changeset 394915 2ac1235b3e002dfba1abe16cad3220358624c621
parent 394914 73f34d2e0b70567baeb7a27c1c47dae98ed4548e
child 394916 a726c48b254057c983e52c254a6fc169dd5e1981
push id33025
push usershindli@mozilla.com
push dateTue, 05 Dec 2017 09:57:50 +0000
treeherdermozilla-central@390c1aad9d4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1339889
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1339889 don't use AnalyserNode smoothing when testing signal r=padenot MozReview-Commit-ID: 23rgwLULjID
dom/media/webaudio/test/test_mediaElementAudioSourceNodeFidelity.html
--- a/dom/media/webaudio/test/test_mediaElementAudioSourceNodeFidelity.html
+++ b/dom/media/webaudio/test/test_mediaElementAudioSourceNodeFidelity.html
@@ -73,16 +73,20 @@ function checkFrequency(an) {
 }
 
 var audioElement = new Audio();
 audioElement.src = 'sine-440-10s.opus'
 audioElement.loop = true;
 var ac = new AudioContext();
 var mediaElementSource = ac.createMediaElementSource(audioElement);
 var an = ac.createAnalyser();
+// Use no smoothing as this would just average with previous
+// getFloatFrequencyData() calls.  Non-seamless looping would introduce noise,
+// and smoothing would spread this into calls after the loop point.
+an.smoothingTimeConstant = 0;
 frequencyArray = new Float32Array(an.frequencyBinCount);
 
 // Uncomment this to check what the analyser is doing.
 // debugCanvas(an);
 
 mediaElementSource.connect(an)
 
 audioElement.play();