mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 22:12:48 -05:00
10 lines
470 B
JavaScript
10 lines
470 B
JavaScript
// StartAudioContext assumes that we are in a window/document setting and messes with the unit
|
|
// tests, this is our own version just checking to see if we have a global document to listen
|
|
// to before we even try to "start" it. Our test api audio context is started by default.
|
|
const StartAudioContext = require('startaudiocontext');
|
|
|
|
module.exports = function (context) {
|
|
if (typeof document !== 'undefined') {
|
|
return StartAudioContext(context);
|
|
}
|
|
};
|