How to use the AudioContext function from three

Find comprehensive JavaScript three.AudioContext code examples handpicked from public code repositorys.

3
4
5
6
7
8
9
10
11
var webvrCheck = require('./helpers/webvrCheck');

var THREE = require('three');
window.THREE = THREE;
if ( !THREE.AudioContext.getContext ){
  THREE.AudioContext.getContext = function(){
    return THREE.AudioContext;
  }
}
fork icon2
star icon13
watch icon5

+ 19 other calls in file

201
202
203
204
205
206
207
208
209
210

// music and sound
const SOUND_FX_GAIN = 2
const [cameraAudioListener] = useState(() => new THREE.AudioListener())
const [atmosphereAudioFilter] = useState(() => {
  const audioContext = THREE.AudioContext.getContext()
  let biquadFilter = audioContext.createBiquadFilter()
  biquadFilter.type = 'highpass'
  biquadFilter.frequency.value = 0
  return biquadFilter
fork icon263
star icon0
watch icon1

+ 3 other calls in file

1252
1253
1254
1255
1256
1257
1258
1259
1260
    dismiss: false
  });
}

if (this.options_.omnitone) {
  var audiocontext = THREE.AudioContext.getContext();
  this.omniController = new OmnitoneController(audiocontext, this.options_.omnitone, this.getVideoEl_(), this.options_.omnitoneOptions);
  this.omniController.one('audiocontext-suspended', function () {
    _this4.player.pause();
fork icon0
star icon0
watch icon1

+ 20 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)