Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 function writeString(s, a, offset) { | 1 function writeString(s, a, offset) { |
| 2 for (var i = 0; i < s.length; ++i) { | 2 for (var i = 0; i < s.length; ++i) { |
| 3 a[offset + i] = s.charCodeAt(i); | 3 a[offset + i] = s.charCodeAt(i); |
| 4 } | 4 } |
| 5 } | 5 } |
| 6 | 6 |
| 7 function writeInt16(n, a, offset) { | 7 function writeInt16(n, a, offset) { |
| 8 n = Math.floor(n); | 8 n = Math.floor(n); |
| 9 | 9 |
| 10 var b1 = n & 255; | 10 var b1 = n & 255; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 var endFrame = timeToSampleFrame(grainOffset + duration, sampleRate); | 256 var endFrame = timeToSampleFrame(grainOffset + duration, sampleRate); |
| 257 | 257 |
| 258 return endFrame - startFrame; | 258 return endFrame - startFrame; |
| 259 } | 259 } |
| 260 | 260 |
| 261 // True if the number is not an infinity or NaN | 261 // True if the number is not an infinity or NaN |
| 262 function isValidNumber(x) { | 262 function isValidNumber(x) { |
| 263 return !isNaN(x) && (x != Infinity) && (x != -Infinity); | 263 return !isNaN(x) && (x != Infinity) && (x != -Infinity); |
| 264 } | 264 } |
| 265 | 265 |
| 266 | |
|
hongchan
2016/03/16 21:51:42
nit: I put 2 spaces intentionally here, but doesn'
Raymond Toy
2016/03/16 21:58:23
I didn't mean to change this file. (I originally h
Raymond Toy
2016/03/18 17:33:04
Done.
| |
| 267 // |Audit| is a task runner for web audio test. It makes asynchronous web audio | 266 // |Audit| is a task runner for web audio test. It makes asynchronous web audio |
| 268 // testing simple and manageable. | 267 // testing simple and manageable. |
| 269 // | 268 // |
| 270 // EXAMPLE: | 269 // EXAMPLE: |
| 271 // | 270 // |
| 272 // var audit = Audit.createTaskRunner(); | 271 // var audit = Audit.createTaskRunner(); |
| 273 // // Define test routine. Make sure to call done() when reached at the end. | 272 // // Define test routine. Make sure to call done() when reached at the end. |
| 274 // audit.defineTask('foo', function (done) { | 273 // audit.defineTask('foo', function (done) { |
| 275 // var context = new AudioContext(); | 274 // var context = new AudioContext(); |
| 276 // // do things | 275 // // do things |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1049 if (opts.hasOwnProperty('verbose')) | 1048 if (opts.hasOwnProperty('verbose')) |
| 1050 _opts.verbose = opts.verbose; | 1049 _opts.verbose = opts.verbose; |
| 1051 if (opts.hasOwnProperty('precision')) | 1050 if (opts.hasOwnProperty('precision')) |
| 1052 _opts.precision = opts.precision; | 1051 _opts.precision = opts.precision; |
| 1053 } | 1052 } |
| 1054 | 1053 |
| 1055 return new ShouldModel(desc, target, _opts); | 1054 return new ShouldModel(desc, target, _opts); |
| 1056 }; | 1055 }; |
| 1057 | 1056 |
| 1058 })(); | 1057 })(); |
| OLD | NEW |