2021-02-07 20:01:37 +01:00

59 lines
1.7 KiB
TypeScript

import { Registry } from "tc-shared/events";
import { DeviceListState } from "tc-shared/audio/recorder";
export declare type MicrophoneSetting = "volume" | "vad-type" | "ppt-key" | "ppt-release-delay" | "ppt-release-delay-active" | "threshold-threshold" | "rnnoise";
export declare type MicrophoneDevice = {
id: string;
name: string;
driver: string;
};
export interface MicrophoneSettingsEvents {
"query_devices": {
refresh_list: boolean;
};
"query_help": {};
"query_setting": {
setting: MicrophoneSetting;
};
"action_help_click": {};
"action_request_permissions": {};
"action_set_selected_device": {
deviceId: string;
};
"action_set_selected_device_result": {
deviceId: string;
status: "success" | "error";
error?: string;
};
"action_set_setting": {
setting: MicrophoneSetting;
value: any;
};
notify_setting: {
setting: MicrophoneSetting;
value: any;
};
"notify_devices": {
status: "success" | "error" | "audio-not-initialized" | "no-permissions";
error?: string;
shouldAsk?: boolean;
devices?: MicrophoneDevice[];
selectedDevice?: string;
};
notify_device_level: {
level: {
[key: string]: {
deviceId: string;
status: "success" | "error";
level?: number;
error?: string;
};
};
status: Exclude<DeviceListState, "error">;
};
notify_highlight: {
field: "hs-0" | "hs-1" | "hs-2" | undefined;
};
notify_destroy: {};
}
export declare function initialize_audio_microphone_controller(events: Registry<MicrophoneSettingsEvents>): void;