|
@@ -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;
|
|
|
|
|