Tone.js/Tone/shim/AnalyserNode.js
tambien 3d1202043a all modules are relative paths
simplifies deep references to individual files
2018-08-26 22:29:17 -04:00

19 lines
549 B
JavaScript

define(["../core/Tone", "../shim/AudioContext"], function(Tone){
/**
* AnalyserNode.getFloatTimeDomainData polyfill
* @private
*/
if (Tone.supported){
if (!AnalyserNode.prototype.getFloatTimeDomainData){
//referenced https://github.com/mohayonao/get-float-time-domain-data
AnalyserNode.prototype.getFloatTimeDomainData = function(array){
var uint8 = new Uint8Array(array.length);
this.getByteTimeDomainData(uint8);
for (var i = 0; i < uint8.length; i++){
array[i] = (uint8[i] - 128) / 128;
}
};
}
}
});