@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.4 → 1.0.6
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/dist/index.d.ts +1 -0
- package/dist/index.js +18 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare class OdysseySpatialComms extends EventManager {
|
|
|
44
44
|
upY: number;
|
|
45
45
|
upZ: number;
|
|
46
46
|
}): void;
|
|
47
|
+
setListenerFromLSD(listenerPos: Position, cameraPos: Position, lookAtPos: Position): void;
|
|
47
48
|
private listenForEvents;
|
|
48
49
|
}
|
|
49
50
|
export type { Direction, MediaState, OdysseyEvent, Participant, Position, RoomJoinedData, };
|
package/dist/index.js
CHANGED
|
@@ -185,6 +185,9 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
185
185
|
setListenerPosition(position, orientation) {
|
|
186
186
|
this.spatialAudioManager.setListenerPosition(position, orientation);
|
|
187
187
|
}
|
|
188
|
+
setListenerFromLSD(listenerPos, cameraPos, lookAtPos) {
|
|
189
|
+
this.spatialAudioManager.setListenerFromLSD(listenerPos, cameraPos, lookAtPos);
|
|
190
|
+
}
|
|
188
191
|
listenForEvents() {
|
|
189
192
|
this.socket.on("new-participant", (participantData) => {
|
|
190
193
|
console.log("👋 SDK: new-participant event received:", {
|
|
@@ -391,13 +394,21 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
391
394
|
participant.consumers.set(consumer.id, consumer);
|
|
392
395
|
if (track.kind === "audio") {
|
|
393
396
|
participant.audioTrack = track;
|
|
394
|
-
|
|
395
|
-
//
|
|
396
|
-
|
|
397
|
-
)
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
397
|
+
// CRITICAL: Do NOT setup spatial audio for local participant (yourself)
|
|
398
|
+
// This prevents hearing your own microphone (loopback)
|
|
399
|
+
const isLocalParticipant = participant.participantId === this.localParticipant?.participantId;
|
|
400
|
+
if (isLocalParticipant) {
|
|
401
|
+
console.log("🔇 SDK: Skipping spatial audio setup for LOCAL participant (yourself) - prevents loopback", participant.participantId);
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
console.log("🎧 SDK: Setting up spatial audio for REMOTE participant", participant.participantId);
|
|
405
|
+
// Setup spatial audio with full 3D positioning
|
|
406
|
+
this.spatialAudioManager.setupSpatialAudioForParticipant(participant.participantId, track, false // Enable spatial audio
|
|
407
|
+
);
|
|
408
|
+
// Update spatial audio position for this participant
|
|
409
|
+
this.spatialAudioManager.updateSpatialAudio(participant.participantId, data.position);
|
|
410
|
+
console.log("📍 SDK: Spatial audio position set:", data.position);
|
|
411
|
+
}
|
|
401
412
|
}
|
|
402
413
|
else if (track.kind === "video") {
|
|
403
414
|
participant.videoTrack = track;
|
package/package.json
CHANGED