teleportxr 1.0.86 → 1.0.88
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.
|
@@ -126,7 +126,7 @@ class GeometryService {
|
|
|
126
126
|
// MAY not be in this set:
|
|
127
127
|
this.streamedNodes.delete(uid);
|
|
128
128
|
// TODO: now reduce the counts for all the dependent resources.
|
|
129
|
-
console.log("Unstreaming node ",
|
|
129
|
+
console.log("Unstreaming node ", uid," for client ", this.clientID);
|
|
130
130
|
}
|
|
131
131
|
StreamOrUnstream(resourceMap, uid, diff) {
|
|
132
132
|
// exclude "undefined"
|
|
@@ -431,7 +431,6 @@ class WebRtcConnection extends EventEmitter
|
|
|
431
431
|
|
|
432
432
|
this.videoDataChannel = this.createDataChannel("video",20);
|
|
433
433
|
this.tagDataChannel = this.createDataChannel("video_tags",40);
|
|
434
|
-
this.audioToClientDataChannel = this.createDataChannel("audio_server_to_client",60);
|
|
435
434
|
this.geometryDataChannel = this.createDataChannel("geometry_unframed",80);
|
|
436
435
|
this.reliableDataChannel = this.createDataChannel("reliable",100);
|
|
437
436
|
this.unreliableDataChannel = this.createDataChannel("unreliable",120,false);
|
|
@@ -539,12 +538,34 @@ class WebRtcConnection extends EventEmitter
|
|
|
539
538
|
return;
|
|
540
539
|
}
|
|
541
540
|
if (this._sceneAudioInterval) {
|
|
542
|
-
|
|
541
|
+
clearInterval(this._sceneAudioInterval);
|
|
542
|
+
this._sceneAudioInterval = null;
|
|
543
543
|
}
|
|
544
544
|
// Drive a 10 ms tick. setInterval is sufficient: RTCAudioSource buffers
|
|
545
545
|
// internally, and a few ms of jitter is absorbed by the WebRTC jitter buffer.
|
|
546
|
+
this._sceneAudioTickCount = 0;
|
|
546
547
|
this._sceneAudioInterval = setInterval(() => {
|
|
547
|
-
if (this._sceneAudioStreamer)
|
|
548
|
+
if (!this._sceneAudioStreamer) return;
|
|
549
|
+
this._sceneAudioStreamer.tick();
|
|
550
|
+
this._sceneAudioTickCount++;
|
|
551
|
+
// Every ~5 s, log tick count + outbound RTP stats so we can confirm
|
|
552
|
+
// libwebrtc is actually transmitting audio packets.
|
|
553
|
+
if ((this._sceneAudioTickCount % 500) === 0) {
|
|
554
|
+
const n = this._sceneAudioTickCount;
|
|
555
|
+
if (typeof this.peerConnection.getStats === 'function') {
|
|
556
|
+
Promise.resolve(this.peerConnection.getStats()).then((report) => {
|
|
557
|
+
let summary = 'no outbound-rtp/audio stats';
|
|
558
|
+
try {
|
|
559
|
+
const entries = (typeof report.values === 'function') ? Array.from(report.values()) : Object.values(report);
|
|
560
|
+
const outRtp = entries.find((s) => s && s.type === 'outbound-rtp' && (s.kind === 'audio' || s.mediaType === 'audio'));
|
|
561
|
+
if (outRtp) summary = 'packetsSent='+outRtp.packetsSent+' bytesSent='+outRtp.bytesSent;
|
|
562
|
+
} catch (e) { summary = 'stats parse error: '+e.message; }
|
|
563
|
+
console.log('SceneAudioStreamer tick #'+n+' — '+summary);
|
|
564
|
+
}).catch((e) => { console.log('SceneAudioStreamer tick #'+n+' — getStats failed: '+e.message); });
|
|
565
|
+
} else {
|
|
566
|
+
console.log('SceneAudioStreamer tick #'+n+' — getStats unavailable');
|
|
567
|
+
}
|
|
568
|
+
}
|
|
548
569
|
}, sound.FRAME_MS);
|
|
549
570
|
console.log('startSceneAudio: streaming '+loaded+' source(s) at '+sound.SAMPLE_RATE+' Hz mono');
|
|
550
571
|
}
|
|
@@ -563,7 +584,6 @@ class WebRtcConnection extends EventEmitter
|
|
|
563
584
|
{
|
|
564
585
|
//.videoDataChannel = .("video",20);
|
|
565
586
|
//.tagDataChannel = .("video_tags",40);
|
|
566
|
-
//.audioToClientDataChannel = .("audio_server_to_client",60);
|
|
567
587
|
//.geometryDataChannel =l("geometry_unframed",80);
|
|
568
588
|
//.reliableDataChannel =l("reliable",100);
|
|
569
589
|
//.unreliableDataChannelnel("unreliable",120,false);
|
package/package.json
CHANGED