<commit_before>Node Core Audio
==================

![alt tag](https://nodei.co/npm-dl/node-core-audio.png)

A C++ extension for node.js that gives javascript access to audio buffers and basic audio processing functionality

<a href="http://flattr.com/thing/1404406/" target="_blank"><img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>

Right now, it's basically a node.js binding for PortAudio.

Installation
=====

```
npm install node-core-audio
```

Disclaimer
=====

I am actively working on this, but if you want to see it happen faster, please send me an email!

Basic Usage
=====

Below is the most basic use of the audio engine. We create a new instance of
node-core-audio, and then give it our processing function. The audio engine
will call the audio callback whenever it needs an output buffer to send to
the sound card.

```javascript
// Create a new instance of node-core-audio
var coreAudio = require("node-core-audio");

// Create a new audio engine
var engine = coreAudio.createNewAudioEngine();

// Add an audio processing callback
// This function accepts an input buffer coming from the sound card,
// and returns an ourput buffer to be sent to your speakers.
//
// Note: This function must return an output buffer
function processAudio( inputBuffer ) {
	console.log( inputBuffer.length + " channels" );
	console.log( "Channel 0 has " = inputBuffer[0].length + " samples" );

	return inputBuffer;
}

engine.addAudioCallback( processAudio );<commit_msg>Improved console.log syntax<commit_after>Node Core Audio
==================

![alt tag](https://nodei.co/npm-dl/node-core-audio.png)

A C++ extension for node.js that gives javascript access to audio buffers and basic audio processing functionality

<a href="http://flattr.com/thing/1404406/" target="_blank"><img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>

Right now, it's basically a node.js binding for PortAudio.

Installation
=====

```
npm install node-core-audio
```

Disclaimer
=====

I am actively working on this, but if you want to see it happen faster, please send me an email!

Basic Usage
=====

Below is the most basic use of the audio engine. We create a new instance of
node-core-audio, and then give it our processing function. The audio engine
will call the audio callback whenever it needs an output buffer to send to
the sound card.

```javascript
// Create a new instance of node-core-audio
var coreAudio = require("node-core-audio");

// Create a new audio engine
var engine = coreAudio.createNewAudioEngine();

// Add an audio processing callback
// This function accepts an input buffer coming from the sound card,
// and returns an ourput buffer to be sent to your speakers.
//
// Note: This function must return an output buffer
function processAudio( inputBuffer ) {
	console.log( "%d channels", inputBuffer.length );
	console.log( "Channel 0 has %d samples", inputBuffer[0].length );

	return inputBuffer;
}

engine.addAudioCallback( processAudio );
{'fraction_non_alphanumeric': 0.1185617103984451, 'fraction_numerical': 0.00647878198898607, 'mean_word_length': 4.398601398601398, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1804488', 'n_tokens_mistral': 889, 'n_tokens_neox': 843, 'n_words': 366}