Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/resources/mix-testing.js

Issue 2895963003: Apply layout-test-tidy to LayoutTests/webaudio (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 var toneLengthSeconds = 1; 1 var toneLengthSeconds = 1;
2 2
3 // Create a buffer with multiple channels. 3 // Create a buffer with multiple channels.
4 // The signal frequency in each channel is the multiple of that in the first cha nnel. 4 // The signal frequency in each channel is the multiple of that in the first
5 // channel.
5 function createToneBuffer(context, frequency, duration, numberOfChannels) { 6 function createToneBuffer(context, frequency, duration, numberOfChannels) {
6 var sampleRate = context.sampleRate; 7 let sampleRate = context.sampleRate;
7 var sampleFrameLength = duration * sampleRate; 8 let sampleFrameLength = duration * sampleRate;
8
9 var audioBuffer = context.createBuffer(numberOfChannels, sampleFrameLength, sampleRate);
10 9
11 var n = audioBuffer.length; 10 let audioBuffer =
11 context.createBuffer(numberOfChannels, sampleFrameLength, sampleRate);
12 12
13 for (var k = 0; k < numberOfChannels; ++k) 13 let n = audioBuffer.length;
14 {
15 var data = audioBuffer.getChannelData(k);
16 14
17 for (var i = 0; i < n; ++i) 15 for (let k = 0; k < numberOfChannels; ++k) {
18 data[i] = Math.sin(frequency * (k + 1) * 2.0*Math.PI * i / sampleRat e); 16 let data = audioBuffer.getChannelData(k);
19 }
20 17
21 return audioBuffer; 18 for (let i = 0; i < n; ++i)
19 data[i] = Math.sin(frequency * (k + 1) * 2.0 * Math.PI * i / sampleRate);
20 }
21
22 return audioBuffer;
22 } 23 }
23
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698