[web-src] Fix audio context creation in Safari

This commit is contained in:
chme 2019-02-19 10:33:07 +01:00
parent 38611f2a77
commit 3bfc8d49ee

View File

@ -4,12 +4,14 @@
*/ */
export default { export default {
_audio: new Audio(), _audio: new Audio(),
_context: new AudioContext(), _context: null,
_source: null, _source: null,
_gain: null, _gain: null,
// setup audio routing // setup audio routing
setupAudio () { setupAudio () {
var AudioContext = window.AudioContext || window.webkitAudioContext
this._context = new AudioContext()
this._source = this._context.createMediaElementSource(this._audio) this._source = this._context.createMediaElementSource(this._audio)
this._gain = this._context.createGain() this._gain = this._context.createGain()