interface.uts
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
export type PcmFrameResult = {
base64 : string
byteLength : number
seq : number
timestamp : number
sampleRate : number
channels : number
bitDepth : number
}
export type StartPcmCaptureSuccess = {
errMsg : string
}
export type StopPcmCaptureSuccess = {
errMsg : string
}
export type PcmCaptureErrorCode = 1400001 | 1400002 | 1400003
export interface PcmCaptureFail extends IUniError {
errCode : PcmCaptureErrorCode
}
export type PcmCaptureFailCallback = (err : PcmCaptureFail) => void
export type StartPcmCaptureSuccessCallback = (res : StartPcmCaptureSuccess) => void
export type StopPcmCaptureSuccessCallback = (res : StopPcmCaptureSuccess) => void
export type PcmCaptureCompleteCallback = (res : any) => void
export type PcmFrameCallback = (res : PcmFrameResult) => void
export type StartPcmCaptureOptions = {
sampleRate ?: number
frameSize ?: number
success ?: StartPcmCaptureSuccessCallback | null
fail ?: PcmCaptureFailCallback | null
complete ?: PcmCaptureCompleteCallback | null
}
export type StopPcmCaptureOptions = {
success ?: StopPcmCaptureSuccessCallback | null
fail ?: PcmCaptureFailCallback | null
complete ?: PcmCaptureCompleteCallback | null
}
export type StartPcmCapture = (options : StartPcmCaptureOptions) => void
export type StopPcmCapture = (options ?: StopPcmCaptureOptions) => void
export type OnPcmFrame = (callback : PcmFrameCallback) => void
export type OffPcmFrame = () => void