@hytopia.com/server-protocol 1.2.5 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/schemas/Audio.ts +24 -7
package/package.json
CHANGED
package/schemas/Audio.ts
CHANGED
|
@@ -3,24 +3,41 @@ import type { JSONSchemaType } from 'ajv';
|
|
|
3
3
|
import type { VectorSchema } from './Vector';
|
|
4
4
|
|
|
5
5
|
export type AudioSchema = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
i?: number; // audio id
|
|
7
|
+
a?: string; // audio uri
|
|
8
|
+
d?: number; // duration
|
|
9
|
+
de?: number; // detune
|
|
10
|
+
f?: number; // follows entity id
|
|
11
|
+
g?: number; // gain (0 to 1, or 1+ for distortion)
|
|
8
12
|
l?: boolean; // loop
|
|
9
13
|
o?: boolean; // one shot
|
|
14
|
+
of?: number; // offset
|
|
15
|
+
p?: VectorSchema; // spatial position of audio
|
|
16
|
+
pr?: number; // playback rate (0+)
|
|
17
|
+
r?: boolean; // restart
|
|
18
|
+
rd?: number; // reference distance
|
|
10
19
|
s?: boolean; // stop
|
|
11
|
-
v?: number; // volume
|
|
20
|
+
v?: number; // volume (0 to 1)
|
|
12
21
|
}
|
|
13
22
|
|
|
14
23
|
export const audioSchema: JSONSchemaType<AudioSchema> = {
|
|
15
24
|
type: 'object',
|
|
16
25
|
properties: {
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
i: { type: 'number', nullable: true },
|
|
27
|
+
a: { type: 'string', nullable: true },
|
|
28
|
+
d: { type: 'number', nullable: true },
|
|
29
|
+
de: { type: 'number', nullable: true },
|
|
30
|
+
f: { type: 'number', nullable: true },
|
|
31
|
+
g: { type: 'number', minimum: 0, nullable: true },
|
|
19
32
|
l: { type: 'boolean', nullable: true },
|
|
20
33
|
o: { type: 'boolean', nullable: true },
|
|
34
|
+
of: { type: 'number', nullable: true },
|
|
35
|
+
p: { ...vectorSchema, nullable: true },
|
|
36
|
+
pr: { type: 'number', minimum: 0, nullable: true },
|
|
37
|
+
r: { type: 'boolean', nullable: true },
|
|
38
|
+
rd: { type: 'number', nullable: true },
|
|
21
39
|
s: { type: 'boolean', nullable: true },
|
|
22
|
-
v: { type: 'number', nullable: true },
|
|
40
|
+
v: { type: 'number', minimum: 0, maximum: 1, nullable: true },
|
|
23
41
|
},
|
|
24
|
-
required: [ 'a' ],
|
|
25
42
|
additionalProperties: false,
|
|
26
43
|
}
|