Communication between C C++ ADDON and Nodejs

Asked

Viewed 403 times

3

They are trying to implement a speech recognition server. But this last part has to be implemented through a C C++ Addon. Currently, I am saving the wav file to the server and passing the name to addon:

var obj1 = julius("nomeficheiro.wav","lista|palavras|possiveis");
word = obj1.recog;//resultado
cm = obj1.cm;//confiança no resultado

However my intention is: not to write files on the disk and do everything through memory. The speech recognizer accepts stdin as possible input. It is possible to pipe between C C++ addon and Nodejs?

  • I believe it is easier to use a socket... Many of the modules that communicate C++ with the Node I know use socket.

2 answers

0

In addition to integration through subprocesses with the module Child Process and Unix Domain Sockets with the module Net. It is possible to use another technique called native integration and this is done using the creation infrastructure of C++ native modules available in Node.Js.

0

Yes it is possible. Node.js has an infrastructure for running processes. This infrastructure is gathered in the module Child Process.

In Node.js you can perform the Piping procedure with a Child process by supplying a readable stream as stdin. For more documentation, visit the subprocess.stdin. of the official documentation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.