scratch-audio/src/StartAudioContext.js

11 lines
470 B
JavaScript
Raw Normal View History

2018-06-19 13:37:00 -04:00
// 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);
}
};