69 lines
2.4 KiB
TypeScript
69 lines
2.4 KiB
TypeScript
|
import { AbstractInput } from "../voice/RecorderBase";
|
||
|
import { KeyDescriptor } from "../PPTListener";
|
||
|
import { ConnectionHandler } from "../ConnectionHandler";
|
||
|
import { IDevice } from "../audio/recorder";
|
||
|
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;
|
||
|
getDeviceId(): string | typeof IDevice.DefaultDeviceId | typeof IDevice.NoDeviceId;
|
||
|
setDevice(device: IDevice | typeof IDevice.DefaultDeviceId | typeof IDevice.NoDeviceId): Promise<void>;
|
||
|
getVolume(): number;
|
||
|
setVolume(volume: number): void;
|
||
|
}
|