-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.d.ts
More file actions
65 lines (56 loc) · 1.82 KB
/
Copy pathindex.d.ts
File metadata and controls
65 lines (56 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/// <reference types="node" />
import { EventEmitter } from 'events';
import { Readable } from 'stream';
declare namespace Microphone {
type Endian = 'big' | 'little';
interface Options {
endian?: Endian;
bitwidth?: string | number;
encoding?: 'signed-integer' | 'unsigned-integer' | string;
rate?: string | number;
channels?: string | number;
fileType?: string;
additionalParameters?: string[] | false;
spawnOptions?: import('child_process').SpawnOptionsWithoutStdio;
useDataEmitter?: boolean;
device?: string;
}
interface InfoEvents {
info: (info: Buffer) => void;
data: (data: Buffer) => void;
error: (error: Error) => void;
close: (code: number | null, signal: NodeJS.Signals | null) => void;
}
}
declare class Microphone extends EventEmitter {
constructor(options?: Microphone.Options);
ps: import('child_process').ChildProcessWithoutNullStreams | null;
endian: Microphone.Endian;
bitwidth: string;
encoding: string;
rate: string;
channels: string;
fileType: string;
additionalParameters: string[] | false;
spawnOptions?: import('child_process').SpawnOptionsWithoutStdio;
useDataEmitter: boolean;
device?: string;
format?: string;
formatEndian?: string;
formatEncoding?: string;
startRecording(): Readable | undefined;
stopRecording(): void;
on<U extends keyof Microphone.InfoEvents>(
event: U,
listener: Microphone.InfoEvents[U],
): this;
once<U extends keyof Microphone.InfoEvents>(
event: U,
listener: Microphone.InfoEvents[U],
): this;
emit<U extends keyof Microphone.InfoEvents>(
event: U,
...args: Parameters<Microphone.InfoEvents[U]>
): boolean;
}
export = Microphone;