mirror of
https://github.com/DPS2004/gba.git
synced 2025-01-22 20:40:32 -03:00
Update XAudioServer.js
This commit is contained in:
parent
c7d1b38f0a
commit
07c792dd00
1 changed files with 12 additions and 2 deletions
|
@ -165,8 +165,17 @@ XAudioServer.prototype.initializeMozAudio = function () {
|
||||||
this.initializeResampler(XAudioJSMozAudioSampleRate);
|
this.initializeResampler(XAudioJSMozAudioSampleRate);
|
||||||
}
|
}
|
||||||
XAudioServer.prototype.initializeWebAudio = function () {
|
XAudioServer.prototype.initializeWebAudio = function () {
|
||||||
|
if (!this.userEventLatch) {
|
||||||
this.setupWebAudio();
|
this.setupWebAudio();
|
||||||
this.resetCallbackAPIAudioBuffer(XAudioJSWebAudioContextHandle.sampleRate);
|
}
|
||||||
|
else {
|
||||||
|
//TODO: Restructure API to not have to potentially lie to end client about
|
||||||
|
//the samples in buffer before user driven event callback that actually starts WA.
|
||||||
|
this.resetCallbackAPIAudioBuffer(44100);
|
||||||
|
}
|
||||||
|
if (typeof AudioContext != "undefined" || typeof XAudioJSWebAudioContextHandle != "undefined") {
|
||||||
|
throw null;
|
||||||
|
}
|
||||||
this.audioType = 1;
|
this.audioType = 1;
|
||||||
/*
|
/*
|
||||||
Firefox has a bug in its web audio implementation...
|
Firefox has a bug in its web audio implementation...
|
||||||
|
@ -237,6 +246,7 @@ XAudioServer.prototype.setupWebAudio = function () {
|
||||||
}
|
}
|
||||||
XAudioJSWebAudioAudioNode.onaudioprocess = XAudioJSWebAudioEvent; //Connect the audio processing event to a handling function so we can manipulate output
|
XAudioJSWebAudioAudioNode.onaudioprocess = XAudioJSWebAudioEvent; //Connect the audio processing event to a handling function so we can manipulate output
|
||||||
XAudioJSWebAudioAudioNode.connect(XAudioJSWebAudioContextHandle.destination); //Send and chain the output of the audio manipulation to the system audio output.
|
XAudioJSWebAudioAudioNode.connect(XAudioJSWebAudioContextHandle.destination); //Send and chain the output of the audio manipulation to the system audio output.
|
||||||
|
this.resetCallbackAPIAudioBuffer(XAudioJSWebAudioContextHandle.sampleRate);
|
||||||
}
|
}
|
||||||
XAudioServer.prototype.initializeFlashAudio = function () {
|
XAudioServer.prototype.initializeFlashAudio = function () {
|
||||||
var existingFlashload = document.getElementById("XAudioJS");
|
var existingFlashload = document.getElementById("XAudioJS");
|
||||||
|
|
Loading…
Add table
Reference in a new issue