@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.76 → 1.0.78

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.
@@ -122,6 +122,9 @@ class SpatialAudioManager extends EventManager_1.EventManager {
122
122
  const monoGainR = this.audioContext.createGain();
123
123
  monoGainL.gain.value = 0.5;
124
124
  monoGainR.gain.value = 0.5;
125
+ // CRITICAL: Convert mono back to stereo for StereoPanner
126
+ // monoMerger outputs 1 channel, but StereoPanner needs 2 channels
127
+ const stereoUpmixer = this.audioContext.createChannelMerger(2);
125
128
  const analyser = this.audioContext.createAnalyser();
126
129
  const gain = this.audioContext.createGain();
127
130
  const proximityGain = this.audioContext.createGain();
@@ -228,13 +231,16 @@ class SpatialAudioManager extends EventManager_1.EventManager {
228
231
  voiceBandFilter.connect(lowpassFilter);
229
232
  lowpassFilter.connect(dynamicLowpass);
230
233
  dynamicLowpass.connect(proximityGain);
231
- // Base routing (always): proximityGain -> mono downmix -> analyser
234
+ // Base routing (always): proximityGain -> mono downmix -> stereo upmix -> analyser
232
235
  proximityGain.connect(monoSplitter);
233
236
  monoSplitter.connect(monoGainL, 0);
234
237
  monoSplitter.connect(monoGainR, 1);
235
238
  monoGainL.connect(monoMerger, 0, 0);
236
239
  monoGainR.connect(monoMerger, 0, 0);
237
- monoMerger.connect(analyser);
240
+ // Convert mono to stereo (same signal on both channels) for StereoPanner
241
+ monoMerger.connect(stereoUpmixer, 0, 0); // mono -> left channel
242
+ monoMerger.connect(stereoUpmixer, 0, 1); // mono -> right channel
243
+ stereoUpmixer.connect(analyser);
238
244
  // Output routing depends on spatialization mode:
239
245
  // - Spatial: analyser -> stereoPanner -> gain -> master
240
246
  // - Non-spatial: analyser -> gain -> master
@@ -254,6 +260,7 @@ class SpatialAudioManager extends EventManager_1.EventManager {
254
260
  monoGainL,
255
261
  monoGainR,
256
262
  monoMerger,
263
+ stereoUpmixer,
257
264
  analyser,
258
265
  gain,
259
266
  proximityGain,
@@ -547,6 +554,7 @@ class SpatialAudioManager extends EventManager_1.EventManager {
547
554
  nodes.monoGainL.disconnect();
548
555
  nodes.monoGainR.disconnect();
549
556
  nodes.monoMerger.disconnect();
557
+ nodes.stereoUpmixer.disconnect();
550
558
  nodes.stereoPanner.disconnect();
551
559
  nodes.analyser.disconnect();
552
560
  nodes.gain.disconnect();
package/dist/index.d.ts CHANGED
@@ -48,6 +48,11 @@ export declare class OdysseySpatialComms extends EventManager {
48
48
  x: number;
49
49
  y: number;
50
50
  } | null;
51
+ rot?: {
52
+ x: number;
53
+ y: number;
54
+ z: number;
55
+ };
51
56
  }): void;
52
57
  updateMediaState(mediaState: MediaState): void;
53
58
  setListenerPosition(position: Position, orientation: {
package/dist/index.js CHANGED
@@ -201,6 +201,7 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
201
201
  roomId: this.room.id,
202
202
  position,
203
203
  direction,
204
+ rot: spatialData?.rot,
204
205
  cameraDistance: spatialData?.cameraDistance,
205
206
  screenPos: spatialData?.screenPos,
206
207
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newgameplusinc/odyssey-audio-video-sdk-dev",
3
- "version": "1.0.76",
3
+ "version": "1.0.78",
4
4
  "description": "Odyssey Spatial Audio & Video SDK using MediaSoup for real-time communication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",