On Tue, Jun 26, 2012 at 8:19 PM, Dan Søndergaard <
dan...@gmail.com> wrote:
> Regarding node's event loop, PortAudio has the following function for
> opening a stream:
>
> Pa_OpenStream (PaStream **stream, const PaStreamParameters *inputParameters,
> const PaStreamParameters *outputParameters, double sampleRate, unsigned long
> framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback
> *streamCallback, void *userData)
>
> Since this function takes a PaStreamCallback I'd guess that PortAudio has
> its own event loop somewhere. My idea right now is to call a JS callback
> function from the PaStreamCallback function in C++. Again, I'm a bit in
> doubt about the interaction between node and the other abstraction layers.
> Can the two event loops interfere?
It depends on how PortAudio works internally. If it's like some other
callback. Use a uv_async_t handle to wake up the event loop and do it