danigb/soundfont-player

Better URL configuration

Closed this issue · 1 comments

Currently the way to change the default url generation is by overriding a class method. While this is good for testing, it's not good for humans. Let's improve it.

Proposals:

  1. Pass the generateUrl function in the constructor: new Soundfont(ctx, function(name) { return ... })
  2. Add options to the constructor: new Soundfont(ctx, { base: 'http://...', format: 'mp3' })
  3. Combine both

Any ideas?

This is now implemented. You can pass a nameToUrl function to the constructor.