提交 c1d67ccf 编写于 作者: M Mr.doob

AudioListener: Renamed masterGain to gain.

上级 0704c6aa
......@@ -9,8 +9,8 @@ THREE.AudioListener = function () {
this.type = 'AudioListener';
this.context = new ( window.AudioContext || window.webkitAudioContext )();
this.masterGain = this.context.createGain();
this.masterGain.connect( this.context.destination );
this.gain = this.context.createGain();
this.gain.connect( this.context.destination );
this.filter = null;
......@@ -21,7 +21,7 @@ THREE.AudioListener.prototype.constructor = THREE.AudioListener;
THREE.AudioListener.prototype.getOutputNode = function () {
return this.masterGain;
return this.gain;
};
......@@ -29,9 +29,9 @@ THREE.AudioListener.prototype.removeFilter = function ( ) {
if ( this.filter !== null ) {
this.masterGain.disconnect( this.filter );
this.gain.disconnect( this.filter );
this.filter.disconnect( this.context.destination );
this.masterGain.connect( this.context.destination );
this.gain.connect( this.context.destination );
this.filter = null;
}
......@@ -42,17 +42,17 @@ THREE.AudioListener.prototype.setFilter = function ( value ) {
if ( this.filter !== null ) {
this.masterGain.disconnect( this.filter );
this.gain.disconnect( this.filter );
this.filter.disconnect( this.context.destination );
} else {
this.masterGain.disconnect( this.context.destination );
this.gain.disconnect( this.context.destination );
}
this.filter = value;
this.masterGain.connect( this.filter );
this.gain.connect( this.filter );
this.filter.connect( this.context.destination );
};
......@@ -65,13 +65,13 @@ THREE.AudioListener.prototype.getFilter = function () {
THREE.AudioListener.prototype.setMasterVolume = function ( value ) {
this.masterGain.gain.value = value;
this.gain.gain.value = value;
};
THREE.AudioListener.prototype.getMasterVolume = function () {
return this.masterGain.gain.value;
return this.gain.gain.value;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册