Browse Source

Audio: Keeping constructor simple.

Mr.doob 10 years ago
parent
commit
493933f428
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/extras/audio/Audio.js

+ 3 - 3
src/extras/audio/Audio.js

@@ -2,14 +2,12 @@
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
  */
  */
 
 
-THREE.Audio = function ( listener, autoplay ) {
+THREE.Audio = function ( listener ) {
 
 
 	THREE.Object3D.call( this );
 	THREE.Object3D.call( this );
 
 
 	this.type = 'Audio';
 	this.type = 'Audio';
 
 
-	this.autoplay = autoplay || false;
-
 	this.context = listener.context;
 	this.context = listener.context;
 	this.source = this.context.createBufferSource();
 	this.source = this.context.createBufferSource();
 	this.source.onended = this.onEnded.bind(this);
 	this.source.onended = this.onEnded.bind(this);
@@ -20,6 +18,8 @@ THREE.Audio = function ( listener, autoplay ) {
 	this.panner = this.context.createPanner();
 	this.panner = this.context.createPanner();
 	this.panner.connect( this.gain );
 	this.panner.connect( this.gain );
 
 
+	this.autoplay = false;
+
 	this.startTime = 0;
 	this.startTime = 0;
 	this.isPlaying = false;
 	this.isPlaying = false;