dataV-xunfei/dists/index.d.ts

31 lines
885 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

declare class RecorderManager {
/**
* 构造函数
* @param processorPath processor的文件路径如果processor.worker.js的访问地址为`/a/b/processor.worker.js`,则processorPath 为`/a/b`
*
*/
constructor(processorPath: string);
private audioBuffers;
private processorPath;
private audioContext?;
private audioTracks?;
private audioWorklet?;
onStop?: (audioBuffers: ArrayBuffer[]) => void;
onFrameRecorded?: (params: {
isLastFrame: boolean;
frameBuffer: ArrayBuffer;
}) => void;
/**
* 监听录音开始事件
*/
onStart?: () => void;
start({ sampleRate, frameSize, arrayBufferType, }: {
sampleRate?: number;
frameSize?: number;
arrayBufferType?: "short16" | "float32";
}): Promise<void>;
stop(): void;
}
export { RecorderManager as default };