LibXtract icon indicating copy to clipboard operation
LibXtract copied to clipboard

node.js bindings?

Open sebpiq opened this issue 11 years ago • 7 comments

Hi Jamie,

Any chance you would implement node.js bindings :) ?

sebpiq avatar Jul 02 '13 07:07 sebpiq

I think it would be great to have node.js bindings for LibXtract, but this isn't something I have time for in the immediate future as it is quite a big task. I will however leave this request open on the tracker as an enhancement request and may get to it later in the year.

If you find a way to automate the generation of node.js bindings from C headers, please let me know.

jamiebullock avatar Jul 02 '13 12:07 jamiebullock

You say "quite a big task", how big in your opinion (1 day, 1 week, 1 month?) ? I'd really need that, so I might try my hand at it ... problem is I know next to nothing about C. Would you provide me a bit of help if I do it?

sebpiq avatar Jul 02 '13 13:07 sebpiq

There seem to be two options here, one is to use Node FFI, which might "just work" if you are very lucky. In this situation, no C code would be necessary to use LibXtract in node.js

The other option would be to write a V8 wrapper for LibXtract. Having looked briefly at the docs, I think this would take me 2-3 days. If you know next to nothing about C, it's going to be extremely difficult and you will have a near impossible learning curve ahead.

My advice is to try Node FFI first. Give me a shout back if it doesn't work...

jamiebullock avatar Jul 02 '13 19:07 jamiebullock

Ok ... I'll take a shot at it, probably this week and I'll tell you what happened :)

sebpiq avatar Jul 03 '13 08:07 sebpiq

aaaarh ... I don't understand anything :( I've tried a few hours to get into this, but considering my knowledge in C, it would take me ages to get to a result ... Any chance you'll have time to take a look at this soon-ish? If you need help with node.js, just ask me.

sebpiq avatar Jul 09 '13 12:07 sebpiq

I'm super busy right now, but I could take a look at this on Friday. No promises.

How about using another method for getting the audio feature data into node? For example, you could use the LibXtract Pd bindings to send OSC to node.js using something like https://github.com/TheAlphaNerd/node-osc

jamiebullock avatar Jul 09 '13 14:07 jamiebullock

you could use the LibXtract Pd bindings to send OSC to node.js

great idea! I'll do that! Thanks!

sebpiq avatar Jul 09 '13 14:07 sebpiq