dataV-xunfei/dists/index.d.ts

31 lines
885 B
TypeScript
Raw Normal View History

2023-10-11 20:39:47 +08:00
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 };