2021-02-20 12:55:36 -05:00
|
|
|
import { AbstractInput } from "../voice/RecorderBase";
|
|
|
|
import { KeyDescriptor } from "../PPTListener";
|
|
|
|
import { ConnectionHandler } from "../ConnectionHandler";
|
2021-03-20 11:18:05 -04:00
|
|
|
import { InputDevice } from "../audio/Recorder";
|
2021-02-20 12:55:36 -05:00
|
|
|
import { Registry } from "tc-shared/events";
|
|
|
|
export declare type VadType = "threshold" | "push_to_talk" | "active";
|
|
|
|
export interface RecorderProfileConfig {
|
|
|
|
version: number;
|
|
|
|
device_id: string | undefined;
|
|
|
|
volume: number;
|
|
|
|
vad_type: VadType;
|
|
|
|
vad_threshold: {
|
|
|
|
threshold: number;
|
|
|
|
};
|
|
|
|
vad_push_to_talk: {
|
|
|
|
delay: number;
|
|
|
|
key_code: string;
|
|
|
|
key_ctrl: boolean;
|
|
|
|
key_windows: boolean;
|
|
|
|
key_shift: boolean;
|
|
|
|
key_alt: boolean;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
export interface DefaultRecorderEvents {
|
|
|
|
notify_default_recorder_changed: {};
|
|
|
|
}
|
|
|
|
export declare let defaultRecorder: RecorderProfile;
|
|
|
|
export declare const defaultRecorderEvents: Registry<DefaultRecorderEvents>;
|
|
|
|
export declare function setDefaultRecorder(recorder: RecorderProfile): void;
|
|
|
|
export interface RecorderProfileEvents {
|
|
|
|
notify_device_changed: {};
|
|
|
|
}
|
|
|
|
export declare class RecorderProfile {
|
|
|
|
readonly events: Registry<RecorderProfileEvents>;
|
|
|
|
readonly name: any;
|
|
|
|
readonly volatile: any;
|
|
|
|
config: RecorderProfileConfig;
|
|
|
|
input: AbstractInput;
|
|
|
|
current_handler: ConnectionHandler;
|
|
|
|
callback_input_initialized: (input: AbstractInput) => void;
|
|
|
|
callback_start: () => any;
|
|
|
|
callback_stop: () => any;
|
|
|
|
callback_unmount: () => any;
|
|
|
|
private readonly pptHook;
|
|
|
|
private pptTimeout;
|
|
|
|
private pptHookRegistered;
|
|
|
|
private registeredFilter;
|
|
|
|
constructor(name: string, volatile?: boolean);
|
|
|
|
destroy(): void;
|
|
|
|
initialize(): Promise<void>;
|
|
|
|
private initializeInput;
|
|
|
|
private save;
|
|
|
|
private reinitializePPTHook;
|
|
|
|
private reinitializeFilter;
|
|
|
|
unmount(): Promise<void>;
|
|
|
|
getVadType(): VadType;
|
|
|
|
setVadType(type: VadType): boolean;
|
|
|
|
getThresholdThreshold(): number;
|
|
|
|
setThresholdThreshold(value: number): void;
|
|
|
|
getPushToTalkKey(): KeyDescriptor;
|
|
|
|
setPushToTalkKey(key: KeyDescriptor): void;
|
|
|
|
getPushToTalkDelay(): number;
|
|
|
|
setPushToTalkDelay(value: number): void;
|
2021-03-20 11:18:05 -04:00
|
|
|
getDeviceId(): string | typeof InputDevice.DefaultDeviceId | typeof InputDevice.NoDeviceId;
|
|
|
|
setDevice(device: InputDevice | typeof InputDevice.DefaultDeviceId | typeof InputDevice.NoDeviceId): Promise<void>;
|
2021-02-20 12:55:36 -05:00
|
|
|
getVolume(): number;
|
|
|
|
setVolume(volume: number): void;
|
|
|
|
}
|