@hytopia.com/server-protocol 1.2.6 → 1.2.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/schemas/Audio.ts +10 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hytopia.com/server-protocol",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/Audio.ts CHANGED
@@ -3,16 +3,19 @@ import type { JSONSchemaType } from 'ajv';
3
3
  import type { VectorSchema } from './Vector';
4
4
 
5
5
  export type AudioSchema = {
6
+ i?: number; // audio id
6
7
  a?: string; // audio uri
7
- c?: VectorSchema; // coordinate of spatial audio origin
8
8
  d?: number; // duration
9
9
  de?: number; // detune
10
+ e?: number; // entity attachment, follows entity id
10
11
  g?: number; // gain (0 to 1, or 1+ for distortion)
11
12
  l?: boolean; // loop
12
13
  o?: boolean; // one shot
13
14
  of?: number; // offset
14
- p?: number; // playback rate (0+)
15
+ p?: VectorSchema; // spatial position of audio
16
+ pr?: number; // playback rate (0+)
15
17
  r?: boolean; // restart
18
+ rd?: number; // reference distance
16
19
  s?: boolean; // stop
17
20
  v?: number; // volume (0 to 1)
18
21
  }
@@ -20,16 +23,19 @@ export type AudioSchema = {
20
23
  export const audioSchema: JSONSchemaType<AudioSchema> = {
21
24
  type: 'object',
22
25
  properties: {
26
+ i: { type: 'number', nullable: true },
23
27
  a: { type: 'string', nullable: true },
24
- c: { ...vectorSchema, nullable: true },
25
28
  d: { type: 'number', nullable: true },
26
29
  de: { type: 'number', nullable: true },
30
+ e: { type: 'number', nullable: true },
27
31
  g: { type: 'number', minimum: 0, nullable: true },
28
32
  l: { type: 'boolean', nullable: true },
29
33
  o: { type: 'boolean', nullable: true },
30
34
  of: { type: 'number', nullable: true },
31
- p: { type: 'number', minimum: 0, nullable: true },
35
+ p: { ...vectorSchema, nullable: true },
36
+ pr: { type: 'number', minimum: 0, nullable: true },
32
37
  r: { type: 'boolean', nullable: true },
38
+ rd: { type: 'number', nullable: true },
33
39
  s: { type: 'boolean', nullable: true },
34
40
  v: { type: 'number', minimum: 0, maximum: 1, nullable: true },
35
41
  },