loadSoundFromFile method
Loads a sound from a file and tracks loading progress.
Implementation
void loadSoundFromFile(Sound sound, String path, Loader loadingInfo) {
var loadingState = loadingInfo.add(path);
_backend.decodeAudioFromFile(path).then((handle) {
sound.bufferHandle = handle;
sound.state = LoadingState.ready;
loadingState.completedOrFailed = true;
}).catchError((e) {
warn("Error loading sound: $path", e);
sound.state = LoadingState.error;
loadingState.completedOrFailed = true;
});
}