Commit 04eea74e authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

Use stereo AudioBuffer instead of RealtimeAnalyserNode in the layout test of...

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.wang@intel.com> on 2012-03-22
Reviewed by Chris Rogers.

* webaudio/stereo2mono-down-mixing.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cc355421
2012-03-22 Xingnan Wang <xingnan.wang@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 <eae@chromium.org>
 
Unreviewed test_expectations update for chromium.
......@@ -15,21 +15,21 @@ description("This test verifies whether down mixing from stereo to mono will cau
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 = audioBuffer.getChannelData(0);
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,20 +49,15 @@ function runTest() {
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(analyser);
analyser.connect(context.destination);
bufferSource.connect(context.destination);
bufferSource.noteOn(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment