Communication between C \ C ++ ADDON and NodeJS

1

This is trying to implement a server capable of speech recognition. But this last part has to be implemented through a C ++ C ++ Addon. At this point, I am writing the wav file on the server and passing the name to the 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 to disk and do everything from memory. The speech recognizer accepts stdin as input. Is it possible to pipe between the C \ C ++ addon and the NodeJs?

    
asked by anonymous 07.07.2015 / 16:29

1 answer

0

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

In node.js you can perform the piping procedure with a child process supplying a readable stream such as stdin. For more documentation, visit the subprocess.stdin section of the official documentation.

    
14.12.2018 / 17:51