-
Notifications
You must be signed in to change notification settings - Fork 1
/
js-binding.d.ts
111 lines (105 loc) · 2.39 KB
/
js-binding.d.ts
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/* auto-generated by NAPI-RS */
/* eslint-disable */
export class OpusEncoder {
static create(sampleRate: number, channels: number): OpusEncoder
hasEncoder(): boolean
hasDecoder(): boolean
encode(data: Buffer): Buffer
decode(data: Buffer): Buffer
setBitrate(bitrate: number): void
getBitrate(): number
applyEncoderCtl(request: number, value: number): void
applyDecoderCtl(request: number, value: number): void
get version(): string
}
export const enum CodecType {
UNKNOWN = 0,
PCM_S32LE = 256,
PCM_S32LE_PLANAR = 257,
PCM_S32BE = 258,
PCM_S32BE_PLANAR = 259,
PCM_S24LE = 260,
PCM_S24LE_PLANAR = 261,
PCM_S24BE = 262,
PCM_S24BE_PLANAR = 263,
PCM_S16LE = 264,
PCM_S16LE_PLANAR = 265,
PCM_S16BE = 266,
PCM_S16BE_PLANAR = 267,
PCM_S8 = 268,
PCM_S8_PLANAR = 269,
PCM_U32LE = 270,
PCM_U32LE_PLANAR = 271,
PCM_U32BE = 272,
PCM_U32BE_PLANAR = 273,
PCM_U24LE = 274,
PCM_U24LE_PLANAR = 275,
PCM_U24BE = 276,
PCM_U24BE_PLANAR = 277,
PCM_U16LE = 278,
PCM_U16LE_PLANAR = 279,
PCM_U16BE = 280,
PCM_U16BE_PLANAR = 281,
PCM_U8 = 282,
PCM_U8_PLANAR = 283,
PCM_F32LE = 284,
PCM_F32LE_PLANAR = 285,
PCM_F32BE = 286,
PCM_F32BE_PLANAR = 287,
PCM_F64LE = 288,
PCM_F64LE_PLANAR = 289,
PCM_F64BE = 290,
PCM_F64BE_PLANAR = 291,
PCM_ALAW = 292,
PCM_MULAW = 293,
ADPCM_G722 = 512,
ADPCM_G726 = 513,
ADPCM_G726LE = 514,
ADPCM_MS = 515,
ADPCM_IMA_WAV = 516,
ADPCM_IMA_QT = 517,
VORBIS = 4096,
MP1 = 4097,
MP2 = 4098,
MP3 = 4099,
AAC = 4100,
OPUS = 4101,
SPEEX = 4102,
MUSEPACK = 4103,
ATRAC1 = 4104,
ATRAC3 = 4105,
ATRAC3PLUS = 4106,
ATRAC9 = 4107,
EAC3 = 4108,
AC4 = 4109,
DCA = 4110,
WMA = 4111,
FLAC = 8192,
WAVPACK = 8193,
MONKEYS_AUDIO = 8194,
ALAC = 8195,
TTA = 8196,
}
export function getOpusVersion(): string
export interface MetadataField {
name: string
value: string
}
export function probe(data: Buffer): Promise<ProbeResult>
export interface ProbeResult {
/** The number of channels */
channels: number
/** The sample rate */
sampleRate: number
/** The number of frames per block */
framesPerBlock: number
/** The codec type */
codec: CodecType
/** The number of frames */
nFrames: number
/** The approximate duration of this media in seconds */
duration: number
/** The metadata object */
metadata: Array<MetadataField>
}
export function probeSync(data: Buffer): ProbeResult