Title: [111728] trunk/LayoutTests
- Revision
- 111728
- Author
- commit-qu...@webkit.org
- Date
- 2012-03-22 10:41:53 -0700 (Thu, 22 Mar 2012)
Log Message
Use stereo AudioBuffer instead of RealtimeAnalyserNode in the layout test of stereo2mono-down-mixing
https://bugs.webkit.org/show_bug.cgi?id=81881
Patch by Xingnan Wang <xingnan.w...@intel.com> on 2012-03-22
Reviewed by Chris Rogers.
* webaudio/stereo2mono-down-mixing.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (111727 => 111728)
--- trunk/LayoutTests/ChangeLog 2012-03-22 17:41:16 UTC (rev 111727)
+++ trunk/LayoutTests/ChangeLog 2012-03-22 17:41:53 UTC (rev 111728)
@@ -1,3 +1,12 @@
+2012-03-22 Xingnan Wang <xingnan.w...@intel.com>
+
+ Use stereo AudioBuffer instead of RealtimeAnalyserNode in the layout test of stereo2mono-down-mixing
+ https://bugs.webkit.org/show_bug.cgi?id=81881
+
+ Reviewed by Chris Rogers.
+
+ * webaudio/stereo2mono-down-mixing.html:
+
2012-03-22 Emil A Eklund <e...@chromium.org>
Unreviewed test_expectations update for chromium.
Modified: trunk/LayoutTests/webaudio/stereo2mono-down-mixing.html (111727 => 111728)
--- trunk/LayoutTests/webaudio/stereo2mono-down-mixing.html 2012-03-22 17:41:16 UTC (rev 111727)
+++ trunk/LayoutTests/webaudio/stereo2mono-down-mixing.html 2012-03-22 17:41:53 UTC (rev 111728)
@@ -15,21 +15,21 @@
var sampleRate = 44100.0;
var renderLengthSeconds = 0.1;
-var fftSize = 32;
var context;
var toneBuffer;
var bufferSource;
-var analyser;
function createDataBuffer(context, lengthInSeconds) {
- var audioBuffer = context.createBuffer(1, lengthInSeconds * sampleRate, sampleRate);
+ var audioBuffer = context.createBuffer(2, lengthInSeconds * sampleRate, sampleRate);
var n = audioBuffer.length;
- var data = ""
+ var data0 = audioBuffer.getChannelData(0);
+ var data1 = audioBuffer.getChannelData(1);
for (var i = 0; i < n; ++i) {
- data[i] = 1.0;
+ data0[i] = 1.0;
+ data1[i] = 1.0;
}
return audioBuffer;
@@ -49,21 +49,16 @@
window.jsTestIsAsync = true;
- // Create offline audio context.
+ // Create offline audio context, the destination is mono.
context = new webkitAudioContext(1, sampleRate * renderLengthSeconds, sampleRate);
- // Explicitly create a mono AudioContext so that the destination is mono.
+ // Create a stereo AudioBuffer.
toneBuffer = createDataBuffer(context, renderLengthSeconds);
bufferSource = context.createBufferSource();
bufferSource.buffer = toneBuffer;
- // We create an analyser here, because it has a hard-coded stereo output.
- analyser = context.createAnalyser();
- analyser.fftSize = fftSize;
+ bufferSource.connect(context.destination);
- bufferSource.connect(analyser);
- analyser.connect(context.destination);
-
bufferSource.noteOn(0);
context._oncomplete_ = testFinished;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes