cleaned out most debug console.logs
This commit is contained in:
parent
b39809e4b3
commit
797d1f28a0
@ -42,13 +42,10 @@ function Input(args) {
|
|||||||
util.inherits(Input, Writable);
|
util.inherits(Input, Writable);
|
||||||
|
|
||||||
Input.prototype.read = function (samples) {
|
Input.prototype.read = function (samples) {
|
||||||
console.log('read()');
|
|
||||||
var bytes = samples * (this.bitDepth / 8) * this.channels;
|
var bytes = samples * (this.bitDepth / 8) * this.channels;
|
||||||
if (this.buffer.length < bytes) bytes = this.buffer.length;
|
if (this.buffer.length < bytes) bytes = this.buffer.length;
|
||||||
console.log(this.buffer.length);
|
|
||||||
var r = this.buffer.slice(0, bytes);
|
var r = this.buffer.slice(0, bytes);
|
||||||
this.buffer = this.buffer.slice(bytes);
|
this.buffer = this.buffer.slice(bytes);
|
||||||
console.log(this.buffer.length);
|
|
||||||
|
|
||||||
if (this.buffer.length <= 131072 && this.getMoreData !== null) {
|
if (this.buffer.length <= 131072 && this.getMoreData !== null) {
|
||||||
var getMoreData = this.getMoreData;
|
var getMoreData = this.getMoreData;
|
||||||
@ -60,7 +57,6 @@ Input.prototype.read = function (samples) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Input.prototype.readMono = function (samples) {
|
Input.prototype.readMono = function (samples) {
|
||||||
console.log('readMono()');
|
|
||||||
// This function will be overridden by this.read, if input already is mono.
|
// This function will be overridden by this.read, if input already is mono.
|
||||||
var stereoBuffer = this.read(samples);
|
var stereoBuffer = this.read(samples);
|
||||||
var monoBuffer = new Buffer(stereoBuffer.length / 2);
|
var monoBuffer = new Buffer(stereoBuffer.length / 2);
|
||||||
@ -74,7 +70,6 @@ Input.prototype.readMono = function (samples) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Input.prototype.readStereo = function (samples) {
|
Input.prototype.readStereo = function (samples) {
|
||||||
console.log('readStereo()');
|
|
||||||
// This function will be overridden by this.read, if input already is stereo.
|
// This function will be overridden by this.read, if input already is stereo.
|
||||||
var monoBuffer = this.read(samples);
|
var monoBuffer = this.read(samples);
|
||||||
var stereoBuffer = new Buffer(monoBuffer.length * 2);
|
var stereoBuffer = new Buffer(monoBuffer.length * 2);
|
||||||
@ -94,8 +89,6 @@ Input.prototype.availSamples = function (length) {
|
|||||||
|
|
||||||
Input.prototype._write = function (chunk, encoding, next) {
|
Input.prototype._write = function (chunk, encoding, next) {
|
||||||
|
|
||||||
console.log('_write', arguments);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (!Buffer.isBuffer(chunk)) {
|
if (!Buffer.isBuffer(chunk)) {
|
||||||
chunk = new Buffer(chunk, encoding);
|
chunk = new Buffer(chunk, encoding);
|
||||||
|
@ -42,15 +42,12 @@ util.inherits(Mixer, Readable);
|
|||||||
|
|
||||||
Mixer.prototype._read = function() {
|
Mixer.prototype._read = function() {
|
||||||
|
|
||||||
console.log('_read', arguments);
|
|
||||||
|
|
||||||
var samples = 9007199254740992;
|
var samples = 9007199254740992;
|
||||||
this.inputs.forEach(function (input) {
|
this.inputs.forEach(function (input) {
|
||||||
var as = input.availSamples();
|
var as = input.availSamples();
|
||||||
if (as < samples) samples = as;
|
if (as < samples) samples = as;
|
||||||
});
|
});
|
||||||
if (samples > 0 && samples != 9007199254740992) {
|
if (samples > 0 && samples != 9007199254740992) {
|
||||||
console.log('read samples', samples);
|
|
||||||
|
|
||||||
var mixedBuffer = new Buffer(samples * this.sampleByteLength * this.channels);
|
var mixedBuffer = new Buffer(samples * this.sampleByteLength * this.channels);
|
||||||
mixedBuffer.fill(0);
|
mixedBuffer.fill(0);
|
||||||
@ -67,7 +64,6 @@ Mixer.prototype._read = function() {
|
|||||||
|
|
||||||
this.push(mixedBuffer);
|
this.push(mixedBuffer);
|
||||||
} else {
|
} else {
|
||||||
console.log('Nothing to read.');
|
|
||||||
setImmediate(this._read.bind(this));
|
setImmediate(this._read.bind(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user