bug 1339889 don't use AnalyserNode smoothing when testing signal r?padenot draft
authorKarl Tomlinson <karlt+@karlt.net>
Sat, 02 Dec 2017 22:09:10 +1300
changeset 706694 5eabc652eb4a665c6522c11427a9e7bc022aa4cd
parent 706693 c1bf00685661d557bae4227945b04fa96c6c89b0
child 742731 f38b46b0cbbaa983e63f8d9740a2ad9b330d8918
push id91882
push userktomlinson@mozilla.com
push dateSun, 03 Dec 2017 22:52:12 +0000
reviewerspadenot
bugs1339889
milestone59.0a1
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();