Browse Source

Add function for setting volume

Matthew Tung 10 years ago
parent
commit
0bf4bb0010
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/extras/audio/Audio.js

+ 6 - 0
src/extras/audio/Audio.js

@@ -64,6 +64,12 @@ THREE.Audio.prototype.setRolloffFactor = function ( value ) {
 
 };
 
+THREE.Audio.prototype.setVolume = function ( value ) {
+
+	this.gain.gain.value = value;
+
+};
+
 THREE.Audio.prototype.updateMatrixWorld = ( function () {
 
 	var position = new THREE.Vector3();