|
@@ -35241,17 +35241,29 @@
|
|
|
|
|
|
var context;
|
|
|
|
|
|
- function getAudioContext() {
|
|
|
+ function AudioContext() {}
|
|
|
|
|
|
- if ( context === undefined ) {
|
|
|
+ Object.assign( AudioContext, {
|
|
|
|
|
|
- context = new ( window.AudioContext || window.webkitAudioContext )();
|
|
|
+ getContext: function () {
|
|
|
|
|
|
- }
|
|
|
+ if ( context === undefined ) {
|
|
|
|
|
|
- return context;
|
|
|
+ context = new ( window.AudioContext || window.webkitAudioContext )();
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ return context;
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ setContext: function ( value ) {
|
|
|
+
|
|
|
+ context = value;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } );
|
|
|
|
|
|
/**
|
|
|
* @author Reece Aaron Lecrivain / http://reecenotes.com/
|
|
@@ -35271,7 +35283,7 @@
|
|
|
loader.setResponseType( 'arraybuffer' );
|
|
|
loader.load( url, function ( buffer ) {
|
|
|
|
|
|
- var context = getAudioContext();
|
|
|
+ var context = AudioContext.getContext();
|
|
|
|
|
|
context.decodeAudioData( buffer, function ( audioBuffer ) {
|
|
|
|
|
@@ -35474,7 +35486,7 @@
|
|
|
|
|
|
this.type = 'AudioListener';
|
|
|
|
|
|
- this.context = getAudioContext();
|
|
|
+ this.context = AudioContext.getContext();
|
|
|
|
|
|
this.gain = this.context.createGain();
|
|
|
this.gain.connect( this.context.destination );
|
|
@@ -42191,7 +42203,7 @@
|
|
|
exports.Camera = Camera;
|
|
|
exports.AudioListener = AudioListener;
|
|
|
exports.PositionalAudio = PositionalAudio;
|
|
|
- exports.getAudioContext = getAudioContext;
|
|
|
+ exports.AudioContext = AudioContext;
|
|
|
exports.AudioAnalyser = AudioAnalyser;
|
|
|
exports.Audio = Audio;
|
|
|
exports.VectorKeyframeTrack = VectorKeyframeTrack;
|
|
@@ -42502,11 +42514,5 @@
|
|
|
|
|
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
|
|
- Object.defineProperty( exports, 'AudioContext', {
|
|
|
- get: function () {
|
|
|
- return exports.getAudioContext();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
})));
|
|
|
//# sourceMappingURL=three.js.map
|