Giter Club home page Giter Club logo

loaders's Introduction

loaders

AudioBuffer loader and other loader utilities module

Example

Load loaders.js in your html file by using:

    <script src="loaders.js"></script>
  // We need an audio context to decode the file
  // By default,the loaders search for audioContext in the window.
  var audioContext = new AudioContext();

  // Load the file passing the path
  var myAudioBufferLoader = new loaders.AudioBufferLoader();
  myAudioBufferLoader.progressCallback = function(obj){
    // Do something with the progress value obj
    // obj: {value:.., total:..., loaded:...}
    // value is loaded/total
  }
  myAudioBufferLoader.load('sound/file/url').then(
      function(buffer){
        // Do something with the loaded audio buffer
      },
      function(error){
        // Catch an error during the loading or decodeAudioData process
      }
  );

Use the same load method to load multiple files, by passing an array of urls ['url/to/file1', 'url/to/file2', ...]. The progress is then an object, eg. {index: 4, value: 0.2, total:999, loaded:1}, where index corresponds to the file index in the array of files, and value, between 0.0 and 1, corresponds to the file loading progress.

Tests

Install all dependencies in the module folder

$ npm install

Run the test suite

$ npm test

It should launch a browser, run the tests in it, and generate the coverage report in the coverage folder.

Status

This library is under heavy development and subject to change. Every new API breaking change we will be adding snapshots to the repository so you can always fetch a working copy.

License

This module is released under the BSD-3-Clause license.

Acknowledgments

This code is part of the WAVE project, funded by ANR (The French National Research Agency), ContInt program, 2012-2015.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.