abcjs 6.0.0-beta.38 → 6.0.0-beta.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE.md +8 -0
- package/dist/abcjs-basic-min.js +2 -2
- package/dist/abcjs-basic.js +23 -5
- package/dist/abcjs-basic.js.map +1 -1
- package/dist/abcjs-plugin-min.js +2 -2
- package/package.json +1 -1
- package/src/synth/create-synth.js +18 -4
- package/temp.txt +0 -0
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -318,11 +318,25 @@ function CreateSynth() {
|
|
|
318
318
|
self.debugCallback("totalSamples = " + totalSamples);
|
|
319
319
|
self.debugCallback("creationTime = " + Math.floor((activeAudioContext().currentTime - startTime)*1000) + "ms");
|
|
320
320
|
}
|
|
321
|
+
function resolveData(me) {
|
|
322
|
+
var duration = me && me.audioBuffers && me.audioBuffers.length > 0 ? me.audioBuffers[0].duration : 0;
|
|
323
|
+
return { status: activeAudioContext().state, duration: duration}
|
|
324
|
+
}
|
|
321
325
|
Promise.all(allPromises).then(function() {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
+
// Safari iOS can mess with the audioContext state, so resume if needed.
|
|
327
|
+
if (activeAudioContext().state === "suspended") {
|
|
328
|
+
activeAudioContext().resume().then(function () {
|
|
329
|
+
resolve(resolveData(self));
|
|
330
|
+
})
|
|
331
|
+
} else if (activeAudioContext().state === "interrupted") {
|
|
332
|
+
activeAudioContext().suspend().then(function () {
|
|
333
|
+
activeAudioContext().resume().then(function () {
|
|
334
|
+
resolve(resolveData(self));
|
|
335
|
+
})
|
|
336
|
+
})
|
|
337
|
+
} else {
|
|
338
|
+
resolve(resolveData(self));
|
|
339
|
+
}
|
|
326
340
|
});
|
|
327
341
|
});
|
|
328
342
|
};
|
package/temp.txt
ADDED
|
File without changes
|
package/version.js
CHANGED