@ircam/sc-loader

1.0.0-alpha.1 • Public • Published

sc-loader

Work in progress

Unified assets loaders between node and browser

Install

npm install --save @ircam/sc-loader

Usage

import { AudioBufferLoader } from '@ircam/sc-loader';

new Loader({ sampleRate, baseUrl });

// load one file
const buffer = await loader.load(filename);

// load array
const buffers = await loader.load([filename, filename, filename]);
loader.get(0);

// load key pathname pairs
const buffers = await loader.load({  });
loader.get('key');

// get last loaded values
loader.getValues();

Notes

Objectives

  • [ ] works seamlessly between node and the browser
  • [ ] able to load many type of files?
    • [ ] AudioBuffers
    • [ ] JSON
    • [ ] raw text
    • [ ] binary format (i.e. midi files)
    • [ ] optionnaly: Images (define what to do in node: ignore, return a blob ?) --> cf component sc-drag-n-drop
  • [ ] should be able to load files locally on the filesystem for node
    • if fs.exists(filename) { loadThis() } else { fetchFromRemoteServer() }

To check

License

BSD-3-Clause

Readme

Keywords

none

Package Sidebar

Install

npm i @ircam/sc-loader

Weekly Downloads

2

Version

1.0.0-alpha.1

License

BSD-3-Clause

Unpacked Size

7.71 kB

Total Files

6

Last publish

Collaborators

  • jipodine
  • norbert.schnell
  • b-ma