Closed b-ma closed 6 months ago
Whoa, that was fast! Per quick look seems very nice. I'm very busy today, OK if I review and test tomorrow?
No problem, let me know!
Can confirm that checking for AudioNode
parent works for my case. However, AudioNode
is not exported, so I have to dig it out by const AudioNode = Object.getPrototypeOf(GainNode)
. I'll try if I can manage to fix this.
Sorry for the delay with this. I had some problems getting the building working (just stupid user errors).
Works with AudioNode.connect
monkeypatching too. See #101 and https://github.com/jampekka/node-web-audio-api/blob/199c5ee5556f3b09a011c4d8f821fe6cabc4aa0b/examples/composite-audio-node.mjs
Not sure if this should be an example though. Perhaps rather a test? Regarding those, npm test
doesn't work currently, changing the test script to mocha tests
does fix this.
P.S. Is making a pull request against this pull request branch the proper way to suggest code changes in review?
Not sure if this should be an example though.
I think it's nice to have as an example, I will have a test with another approach which I think could be a bit more clean (i.e. extending GainNode or something), but as it's proposed by google dev its nice to have here anyway
Regarding those, npm test doesn't work currently, changing the test script to mocha tests does fix this.
Yup, I always run them explicitely npm test -- tests/*.spec.js
, maybe should be added in README ?
All flags green :) Thanks
I think it's nice to have as an example, I will have a test with another approach which I think could be a bit more clean (i.e. extending GainNode or something), but as it's proposed by google dev its nice to have here anyway
Extending GainNode should work. But for composition I think you still have to hack the .connect somehow. The Google dev proposal is from 2016, when the spec (or implementations) maybe didn't support AudioNode constructors, so there may be cleaner ways now, although I didn't find one.
Yup, I always run them explicitely npm test -- tests/*.spec.js, maybe should be added in README ?
Would be helpful for new contributors. What's the reason not to have this as the npm test script? Does that e.g. get automatically run by some toolchain but we don't want to run them?
(I think you mean npm test -- tests/*.spec.mjs)
Extending GainNode should work. But for composition I think you still have to hack the .connect somehow. The Google dev proposal is from 2016, when the spec (or implementations) maybe didn't support AudioNode constructors, so there may be cleaner ways now, although I didn't find one.
I've never really tried myself, but that's something I'm quite interested in for creating audio libs, that's the occasion :)
Would be helpful for new contributors. What's the reason not to have this as the npm test script? Does that e.g. get automatically run by some toolchain but we don't want to run them?
Don't really know, probably just that I'm used to it... let's do that, this is more simple, we can always call mocha directly if needed
Review the architecture to use facades instead of mixins to better follow spec inheritance (should fix #97)
main
feat/inheritance-chain
@jampekka could you confirm it works for your use-case? If it does having a simple example would be really welcome!