ttencate/jfxr

How to incorporate player only into an app?

radman-x opened this issue · 4 comments

For example, something like the "How to use it?" section here:
https://github.com/loov/jsfx

Just to be clear, we do not want the GUI/Designer, just want to be able to play the *.jfxr files in our app (or convert to base64 via web audio context).

This is not a feature I had in mind when I wrote jfxr, but it should be possible. Here's a high level overview:

  • Grab sound.js, in its entirety. The Sound class stores all the sound's parameters and parses the JSON from the *.jfxr file.
  • Grab synth.js minus the Angular service at the top. The Synth class generates the actual sound. This happens in chunks so it doesn't block the browser. You could also put the entire generation in a web worker instead. (I think I didn't use web workers in jfxr because it's hard to interrupt them when the user changes a value in the UI.)
  • Get a promise library to replace the Angular $q service, or rely on native browser support, or change it to use old fashioned callbacks instead.
  • Replace $timeout by window.setTimeout.

Maybe some day I'll refactor the synth into a standalone library, but not any time soon – I'm up to my ears in unpaid projects already. If you have a budget, we can discuss speeding it up ;)

OK, thanx for the quick response. Sounds like a little too much to attempt at this time. We will probably use jsfx. If we run into limitations that jfxr could get around and/or get a budget, we'll contact you again.

No probs, good luck!