MCPcopy Create free account
hub / github.com/diffusionstudio/vits-web / asyncLoad

Function asyncLoad

src/piper.js:1821–1839  ·  view source on GitHub ↗
(url, onload, onerror, noRunDep)

Source from the content-addressed store, hash-verified

1819 },
1820 };
1821 var asyncLoad = (url, onload, onerror, noRunDep) => {
1822 var dep = !noRunDep ? getUniqueRunDependency(`al ${url}`) : '';
1823 readAsync(
1824 url,
1825 (arrayBuffer) => {
1826 assert(arrayBuffer, `Loading data file "${url}" failed (no arrayBuffer).`);
1827 onload(new Uint8Array(arrayBuffer));
1828 if (dep) removeRunDependency(dep);
1829 },
1830 (event) => {
1831 if (onerror) {
1832 onerror();
1833 } else {
1834 throw `Loading data file "${url}" failed.`;
1835 }
1836 },
1837 );
1838 if (dep) addRunDependency(dep);
1839 };
1840 var FS_createDataFile = (parent, name, fileData, canRead, canWrite, canOwn) =>
1841 FS.createDataFile(parent, name, fileData, canRead, canWrite, canOwn);
1842 var preloadPlugins = Module['preloadPlugins'] || [];

Callers 1

FS_createPreloadedFileFunction · 0.85

Calls 4

getUniqueRunDependencyFunction · 0.85
assertFunction · 0.85
removeRunDependencyFunction · 0.85
addRunDependencyFunction · 0.85

Tested by

no test coverage detected