mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 08:17:07 +00:00
removed ability to set new AudioContext
for now…
This commit is contained in:
parent
7d02476732
commit
93d053aec5
1 changed files with 5 additions and 20 deletions
|
@ -41,16 +41,12 @@
|
|||
|
||||
//SHIMS////////////////////////////////////////////////////////////////////
|
||||
|
||||
function shimAudioContext(ac){
|
||||
if (typeof ac.createGain !== "function"){
|
||||
ac.createGain = ac.createGainNode;
|
||||
}
|
||||
if (typeof ac.createDelay !== "function"){
|
||||
ac.createDelay = ac.createDelayNode;
|
||||
}
|
||||
if (typeof audioContext.createGain !== "function"){
|
||||
audioContext.createGain = audioContext.createGainNode;
|
||||
}
|
||||
if (typeof audioContext.createDelay !== "function"){
|
||||
audioContext.createDelay = audioContext.createDelayNode;
|
||||
}
|
||||
|
||||
shimAudioContext(audioContext);
|
||||
|
||||
if (typeof AudioBufferSourceNode.prototype.start !== "function"){
|
||||
AudioBufferSourceNode.prototype.start = AudioBufferSourceNode.prototype.noteGrainOn;
|
||||
|
@ -358,16 +354,5 @@
|
|||
child.prototype.constructor = child;
|
||||
};
|
||||
|
||||
/**
|
||||
* sets an audio context different from the original one
|
||||
* [note] the new context will be shimmed
|
||||
*
|
||||
* @param {AudioContext} ac
|
||||
*/
|
||||
Tone.setAudioContext = function(ac){
|
||||
audioContext = ac;
|
||||
shimAudioContext(ac);
|
||||
};
|
||||
|
||||
return Tone;
|
||||
}));
|
||||
|
|
Loading…
Reference in a new issue