|
|
@@ -396,6 +396,44 @@ class Audio extends Object3D {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source, recursive ) {
|
|
|
+
|
|
|
+ super.copy( source, recursive );
|
|
|
+
|
|
|
+ this.autoplay = source.autoplay;
|
|
|
+
|
|
|
+ this.buffer = source.buffer;
|
|
|
+ this.detune = source.detune;
|
|
|
+ this.loop = source.loop;
|
|
|
+ this.loopStart = source.loopStart;
|
|
|
+ this.loopEnd = source.loopEnd;
|
|
|
+ this.offset = source.offset;
|
|
|
+ this.duration = source.duration;
|
|
|
+ this.playbackRate = source.playbackRate;
|
|
|
+ this.hasPlaybackControl = source.hasPlaybackControl;
|
|
|
+
|
|
|
+ this.filters = source.filters.slice();
|
|
|
+
|
|
|
+ if ( source.sourceType !== 'buffer' ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.Audio: Audio source type cannot be copied.' );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ this.sourceType = source.sourceType;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ clone( recursive ) {
|
|
|
+
|
|
|
+ return new this.constructor( this.listener ).copy( this, recursive );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
export { Audio };
|