-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
Description of the problem
AudioLoader calls scope.manager.itemEnd (through the file loader) after loading the buffer, but its own onLoad after decoding it. Since decoding the buffer is asynchronous (or at least, has a callback) you can get into a race condition if the audio loader is the last loader in the loading manager's queue, where the manager thinks all of it's items are finished but the individual loaders haven't finished parsing. We noticed this in our preloading situation and had to implement our own loading queue that used the per-item onLoad to tick off complete items.
Unfortunately, looking at FileLoader/AudioLoader source, I'm not sure how to fix this or if it's even a concern; maybe the easiest solution to just clarify in the docs that LoadingManager#onLoad only indicates the network request is finished, and doesn't indicate that the data has been parsed.
Three.js version
- r84
Browser
- All of them
OS
- All of them