Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/mic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var mic = function mic(options) {
var exitOnSilence = options.exitOnSilence || 0;
var fileType = options.fileType || 'raw';
var debug = options.debug || false;
var buffer = options.buffer || 500;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please fix the indentation?

var format, formatEndian, formatEncoding;
var audioProcess = null;
var infoStream = new PassThrough;
Expand Down Expand Up @@ -47,18 +48,20 @@ var mic = function mic(options) {
if(isWindows){
audioProcess = spawn('sox', ['-b', bitwidth, '--endian', endian,
'-c', channels, '-r', rate, '-e', encoding,
'-t', 'waveaudio', 'default', '-p'],
'-t', '--buffer', buffer , 'waveaudio', 'default', '-p'],
audioProcessOptions)
}
else if(isMac){
audioProcess = spawn('rec', ['-b', bitwidth, '--endian', endian,
'-c', channels, '-r', rate, '-e', encoding,
'-t', fileType, '-'], audioProcessOptions)
'-t', fileType, '--buffer', buffer , '-'], audioProcessOptions)
}
else {
var buffer_time=(buffer/rate)*1000000;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the indentation

audioProcess = spawn('arecord', ['-c', channels, '-r', rate, '-f',
format, '-D', device], audioProcessOptions);
format, '-D', device, '--buffer-time', buffer_time], audioProcessOptions);
}
if(debug)console.log(audioProcess);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the indentation


audioProcess.on('exit', function(code, sig) {
if(code != null && sig === null) {
Expand Down