-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to send data continually to javascript from windows Wave API callback function? #406
Comments
Hi @CTianXing, |
@CTianXing @romandev is working on providing a C++ wrapper for napi_threadsafe_function. In the meantime, you can use the C API directly. At any rate, you should replace Napi::Function cbemit; with napi_threadsafe_function cbemit; which you then create using Realize though that this calls a JavaScript function rather than emitting a JavaScript event. However, in your |
@NickNaso @gabrielschulhof Thank you very much! |
@CTianXing sounds like you're using |
sorry for my poor english, hope you understand what I mean.
I take the windows Wave API to record sound and send it to speech recognize. There is a callback in the waveInOpen(), i can take the buffer recorded to recognize and get the result continually,but how do i send the result to javascript in the waveInProc().
MMRESULT waveInOpen(
LPHWAVEIN phwi,
UINT uDeviceID,
LPCWAVEFORMATEX pwfx,
DWORD_PTR dwCallback,
DWORD_PTR dwCallbackInstance,
DWORD fdwOpen
);
void CALLBACK waveInProc(
HWAVEIN hwi,
UINT uMsg,
DWORD_PTR dwInstance,
DWORD_PTR dwParam1,
DWORD_PTR dwParam2
);
I try to emit events from addon, it has error"Entering the V8 API without proper locking in place“. I don't know how to use Asynchronous Thread-safe Function Calls and if it works. So I'm here for help. Thank you.
record2recognize.txt
The text was updated successfully, but these errors were encountered: