node-mic
Version:
Microphone streaming library for Node.js
37 lines (36 loc) • 944 B
TypeScript
import { AudioStream } from './audio.js';
export interface MicOptions {
endian: 'big' | 'little';
bitwidth: number;
encoding: 'signed-integer' | 'unsigned-integer';
rate: number;
channels: number;
device: string;
threshold: number;
fileType: 'wav' | 'raw';
debug: boolean;
}
export default class Mic {
private _rate;
private _channels;
private _device;
private _fileType;
private _debug;
private _audioStream;
private _infoStream;
private _format;
private _audioProcessOptions;
private _encoding;
private _bitwidth;
private _endian;
private _audioProcess;
constructor(options?: Partial<MicOptions>);
start(): void;
protected spawnWindows(sox: string): void;
protected spawnMac(rec: string): void;
protected spawnLinux(arecord: string): void;
stop(): void;
pause(): void;
resume(): void;
getAudioStream(): AudioStream;
}