-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
33 lines (27 loc) · 908 Bytes
/
index.d.ts
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
/// <reference types="node" />
// enum Host API for rust CPAL
export enum HostApi {
ALSA = "ALSA",
COREAUDIO = "CoreAudio",
JACK = "JACK",
PULSEAUDIO = "PulseAudio",
ASIO = "ASIO",
WASAPI = "WASAPI",
}
declare interface AudioDevice {
name: string;
inputChannels: number;
outputChannels: number;
host: HostApi;
error?: string;
}
declare interface AudioFeedback {
speakingProb: number;
volume: number;
channelId: number;
}
type SharedState = unknown;
export declare function getAllDevices(): AudioDevice[];
export declare function getDevice(name: AudioDevice['name'], host: HostApi|undefined): AudioDevice;
export declare function start(name: AudioDevice['name'], host: HostApi|undefined, path: string|null, callback: (err: Error, data: AudioFeedback[]) => void, gain?: number): SharedState;
export declare function stop(state: SharedState): void;