mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
79a0e22fd7
was always passing in NaN
16 lines
No EOL
390 B
JavaScript
16 lines
No EOL
390 B
JavaScript
define(["helper/Offline"], function (Offline) {
|
|
|
|
return function(callback, duration, channels){
|
|
|
|
return Offline(callback, duration, channels).then(function(buffer){
|
|
var rms = buffer.getRMS(512);
|
|
rms.forEach = function(callback){
|
|
for (var i = 0; i < rms.length; i++){
|
|
var level = rms[i];
|
|
callback(level, i * buffer.sampleTime);
|
|
}
|
|
};
|
|
return rms;
|
|
});
|
|
};
|
|
}); |