Better sample loading
This commit is contained in:
parent
92d3fe496d
commit
daea207aff
5 changed files with 33 additions and 15 deletions
|
|
@ -289,7 +289,7 @@ export async function onTriggerSample(t, value, onended, bank, resolveUrl) {
|
|||
const { bufferSource, sliceDuration, offset } = await getSampleBufferSource(value, bank, resolveUrl);
|
||||
|
||||
// asny stuff above took too long?
|
||||
if (ac.currentTime > t) {
|
||||
if (ac.currentTime > t && !(ac instanceof OfflineAudioContext)) {
|
||||
logger(`[sampler] still loading sound "${s}:${n}"`, 'highlight');
|
||||
// console.warn('sample still loading:', s, n);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -562,7 +562,7 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ac.currentTime > t) {
|
||||
if (ac.currentTime > t && !(ac instanceof OfflineAudioContext)) {
|
||||
logger('[webaudio] skip hap: still loading', ac.currentTime - t);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue