Giter Club home page Giter Club logo

waves-loaders's People

Contributors

b-ma avatar goldszmidt avatar kbarkati avatar ouhouhsami avatar vectorsize avatar yomguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

waves-loaders's Issues

decodeAudioData error

The error should be clearer, with the filename for example.
This could be achieve using index in map to get the filename.

Global progress for the SuperLoader

So far, we get the individual progress value of each file. That'd be great to also have the global progress value (which is the weighted average of the individual progress values).

unsupported audio formats

At the moment when loading an unsupported audio format the browser returns an error without any explanations, perhaps we can support that in the loader?

here's an example of how one can check the browser's capabilities:

var myAudio = document.createElement('audio'); 

if (myAudio.canPlayType) {
  // Currently canPlayType(type) returns: "", "maybe" or "probably" 
  var canPlayMp3 = !!myAudio.canPlayType && "" != myAudio.canPlayType('audio/mpeg');
  var canPlayOgg = !!myAudio.canPlayType && "" != myAudio.canPlayType('audio/ogg; codecs="vorbis"');

  console.log(canPlayMp3, canPlayOgg);
}

README example seems buggy ?

myAudioBufferLoader.progressCallback = function(val){
  // Do something with the progress value
}
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
  }
);

instead of

AudioBufferLoader.progressCallback = function(val){
  // Do something with the progress value
}
AudioBufferLoader.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
  }
);

Progression

test progression or better, extrenalyze this event, nothing to do with promise => out of the scope of the lib !

Promise-fulfillment swallows exception

It's a knows bug/feature: kriskowal/q#30

  // We need an audio context to decode the file
  // By default, buffer-loader search for audioContext in the window.
  var audioContext = new AudioContext();

  // Load the file passing the path
  var myBufferLoader = createBufferLoader();
  myBufferLoader.load('FILE_URL').then(
      function(buffer){
        // Here we throw an Error
        // But without the done function below, the error would have been swallowed
        throw new Error('Error');
      }
  ).done(
    function(result){
      console.log(result); // Here we will get the error
    }
  );

So, for the moment, the solution to catch programmatic errors is to use done()

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.