ZECTBynmo/node-core-audio — pull request #2 by MArcJ (2012-12-06 00:46:21+00:00)
Title: Fixed OSX build and added a couple of features.

This rfc provides several new methods and new behaviors of the whole module.

The constructor now accepts as first argument the option object and as second the audio callback function (also with new arguments) - both are optional.

You can now set following options:
```
inputChannels: int,
outputChannels: int,
inputDevice: int,
outputDevice: int,
sampleRate: int,
sampleFormat: int,
framesPerBuffer: int,
interleaved: bool
```

New audio callback:
```
function(input, lastInputOverflowed, lastOutputUnderflowed) {}
```

New methods (blocking i/o read/write):
```
array audio.read();
bool audio.write(array input);
array audio.getOptions();
void audio.setOptions(array options);
```
The get/set-Options replaces all other methods, that handles same data as those ones.

I've also changed the identation of the files (to 4 spaces), removed the whole portaudio folder (but let the portaudio.h file exists, since on some machines node-gyp doesn't find the file in the OS files) and implemented the streaming process through the blocking i/o methods from portaudio in a own thread.

In the updated README.md you'll find more information about the new structure.

I have no idea, whether it works on all Windows machines, but for it there's still the .dll file. Maybe you can take a look over it.

Known issues (maybe you can help here too): The `audioEngine` object in the AudioEngineTest.js is automatically deleted from the garbage collector if we do not use it in e endless loop of the setInterval() function. I believe there should be somewhere in the c++ code a Persisten<> directive, but have no idea currently.