mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-17 00:58:09 +00:00
34 lines
No EOL
689 B
JavaScript
34 lines
No EOL
689 B
JavaScript
define(["Tone/core/Tone", "Tone/signal/WaveShaper", "Tone/signal/Signal"], function(Tone){
|
|
|
|
"use strict";
|
|
|
|
/**
|
|
* @class AudioToGain converts an input range of -1,1 to 0,1
|
|
*
|
|
* @extends {Tone.SignalBase}
|
|
* @constructor
|
|
*/
|
|
Tone.AudioToGain = function(){
|
|
|
|
/**
|
|
* @type {WaveShaperNode}
|
|
* @private
|
|
*/
|
|
this._norm = this.input = this.output = new Tone.WaveShaper([0,1]);
|
|
};
|
|
|
|
Tone.extend(Tone.AudioToGain, Tone.SignalBase);
|
|
|
|
/**
|
|
* clean up
|
|
* @returns {Tone.AND} `this`
|
|
*/
|
|
Tone.AudioToGain.prototype.dispose = function(){
|
|
Tone.prototype.dispose.call(this);
|
|
this._norm.disconnect();
|
|
this._norm = null;
|
|
return this;
|
|
};
|
|
|
|
return Tone.AudioToGain;
|
|
}); |