@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.5 → 1.0.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/dist/index.js +24 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -394,13 +394,30 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
394
394
|
participant.consumers.set(consumer.id, consumer);
|
|
395
395
|
if (track.kind === "audio") {
|
|
396
396
|
participant.audioTrack = track;
|
|
397
|
-
|
|
398
|
-
//
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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
|
+
console.log("🔍 SDK: Checking if local participant:", {
|
|
401
|
+
participantId: participant.participantId,
|
|
402
|
+
localParticipantId: this.localParticipant?.participantId,
|
|
403
|
+
isLocalParticipant,
|
|
404
|
+
producerId: data.producerId,
|
|
405
|
+
trackKind: track.kind
|
|
406
|
+
});
|
|
407
|
+
if (isLocalParticipant) {
|
|
408
|
+
console.warn("🔇 SDK: SKIPPING spatial audio for LOCAL participant (yourself) - prevents loopback", participant.participantId);
|
|
409
|
+
// Do NOT connect this audio to Web Audio API
|
|
410
|
+
return; // Exit early to prevent any audio processing
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
console.log("🎧 SDK: Setting up spatial audio for REMOTE participant", participant.participantId);
|
|
414
|
+
// Setup spatial audio with full 3D positioning
|
|
415
|
+
this.spatialAudioManager.setupSpatialAudioForParticipant(participant.participantId, track, false // Enable spatial audio
|
|
416
|
+
);
|
|
417
|
+
// Update spatial audio position for this participant
|
|
418
|
+
this.spatialAudioManager.updateSpatialAudio(participant.participantId, data.position);
|
|
419
|
+
console.log("📍 SDK: Spatial audio position set:", data.position);
|
|
420
|
+
}
|
|
404
421
|
}
|
|
405
422
|
else if (track.kind === "video") {
|
|
406
423
|
participant.videoTrack = track;
|
package/package.json
CHANGED