@aether-stack-dev/client-sdk 1.2.0 → 1.2.1

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.
@@ -67,6 +67,7 @@ export declare class AStackCSRClient extends EventEmitter<AStackCSREvents> {
67
67
  startCall(options?: CallOptions): Promise<void>;
68
68
  private startImageCapture;
69
69
  private captureAndSendImage;
70
+ private cleanupLocalAudio;
70
71
  stopCall(): void;
71
72
  sendText(message: string): void;
72
73
  disconnect(): Promise<void>;
package/dist/index.esm.js CHANGED
@@ -239,7 +239,7 @@ class AStackCSRClient extends EventEmitter {
239
239
  this.hasConnected = true;
240
240
  if (isReconnect) {
241
241
  if (this.callStatus === 'active' || this.callStatus === 'starting') {
242
- this.stopCall();
242
+ this.cleanupLocalAudio();
243
243
  this.emit('callStopped');
244
244
  }
245
245
  this.emit('reconnected');
@@ -568,6 +568,33 @@ class AStackCSRClient extends EventEmitter {
568
568
  timestamp: Date.now()
569
569
  }));
570
570
  }
571
+ cleanupLocalAudio() {
572
+ if (this.imageCaptureInterval) {
573
+ clearInterval(this.imageCaptureInterval);
574
+ this.imageCaptureInterval = null;
575
+ }
576
+ if (this.videoRef) {
577
+ this.videoRef.srcObject = null;
578
+ this.videoRef = null;
579
+ }
580
+ if (this.mediaStream) {
581
+ this.mediaStream.getTracks().forEach(track => track.stop());
582
+ this.mediaStream = null;
583
+ }
584
+ if (this.audioProcessor) {
585
+ this.audioProcessor.disconnect();
586
+ this.audioProcessor.port.onmessage = null;
587
+ this.audioProcessor = null;
588
+ }
589
+ if (this.audioContext) {
590
+ this.audioContext.close();
591
+ this.audioContext = null;
592
+ }
593
+ this.audioPlayer.clearQueue();
594
+ this.callStatus = 'idle';
595
+ this.currentBlendshapes = new Array(BLENDSHAPE_COUNT).fill(0);
596
+ this.emit('blendshapeUpdate', this.currentBlendshapes);
597
+ }
571
598
  stopCall() {
572
599
  if (this.imageCaptureInterval) {
573
600
  clearInterval(this.imageCaptureInterval);
package/dist/index.js CHANGED
@@ -243,7 +243,7 @@ class AStackCSRClient extends eventemitter3.EventEmitter {
243
243
  this.hasConnected = true;
244
244
  if (isReconnect) {
245
245
  if (this.callStatus === 'active' || this.callStatus === 'starting') {
246
- this.stopCall();
246
+ this.cleanupLocalAudio();
247
247
  this.emit('callStopped');
248
248
  }
249
249
  this.emit('reconnected');
@@ -572,6 +572,33 @@ class AStackCSRClient extends eventemitter3.EventEmitter {
572
572
  timestamp: Date.now()
573
573
  }));
574
574
  }
575
+ cleanupLocalAudio() {
576
+ if (this.imageCaptureInterval) {
577
+ clearInterval(this.imageCaptureInterval);
578
+ this.imageCaptureInterval = null;
579
+ }
580
+ if (this.videoRef) {
581
+ this.videoRef.srcObject = null;
582
+ this.videoRef = null;
583
+ }
584
+ if (this.mediaStream) {
585
+ this.mediaStream.getTracks().forEach(track => track.stop());
586
+ this.mediaStream = null;
587
+ }
588
+ if (this.audioProcessor) {
589
+ this.audioProcessor.disconnect();
590
+ this.audioProcessor.port.onmessage = null;
591
+ this.audioProcessor = null;
592
+ }
593
+ if (this.audioContext) {
594
+ this.audioContext.close();
595
+ this.audioContext = null;
596
+ }
597
+ this.audioPlayer.clearQueue();
598
+ this.callStatus = 'idle';
599
+ this.currentBlendshapes = new Array(BLENDSHAPE_COUNT).fill(0);
600
+ this.emit('blendshapeUpdate', this.currentBlendshapes);
601
+ }
575
602
  stopCall() {
576
603
  if (this.imageCaptureInterval) {
577
604
  clearInterval(this.imageCaptureInterval);
package/dist/react.esm.js CHANGED
@@ -245,7 +245,7 @@ class AStackCSRClient extends EventEmitter {
245
245
  this.hasConnected = true;
246
246
  if (isReconnect) {
247
247
  if (this.callStatus === 'active' || this.callStatus === 'starting') {
248
- this.stopCall();
248
+ this.cleanupLocalAudio();
249
249
  this.emit('callStopped');
250
250
  }
251
251
  this.emit('reconnected');
@@ -574,6 +574,33 @@ class AStackCSRClient extends EventEmitter {
574
574
  timestamp: Date.now()
575
575
  }));
576
576
  }
577
+ cleanupLocalAudio() {
578
+ if (this.imageCaptureInterval) {
579
+ clearInterval(this.imageCaptureInterval);
580
+ this.imageCaptureInterval = null;
581
+ }
582
+ if (this.videoRef) {
583
+ this.videoRef.srcObject = null;
584
+ this.videoRef = null;
585
+ }
586
+ if (this.mediaStream) {
587
+ this.mediaStream.getTracks().forEach(track => track.stop());
588
+ this.mediaStream = null;
589
+ }
590
+ if (this.audioProcessor) {
591
+ this.audioProcessor.disconnect();
592
+ this.audioProcessor.port.onmessage = null;
593
+ this.audioProcessor = null;
594
+ }
595
+ if (this.audioContext) {
596
+ this.audioContext.close();
597
+ this.audioContext = null;
598
+ }
599
+ this.audioPlayer.clearQueue();
600
+ this.callStatus = 'idle';
601
+ this.currentBlendshapes = new Array(BLENDSHAPE_COUNT).fill(0);
602
+ this.emit('blendshapeUpdate', this.currentBlendshapes);
603
+ }
577
604
  stopCall() {
578
605
  if (this.imageCaptureInterval) {
579
606
  clearInterval(this.imageCaptureInterval);
package/dist/react.js CHANGED
@@ -266,7 +266,7 @@ class AStackCSRClient extends eventemitter3.EventEmitter {
266
266
  this.hasConnected = true;
267
267
  if (isReconnect) {
268
268
  if (this.callStatus === 'active' || this.callStatus === 'starting') {
269
- this.stopCall();
269
+ this.cleanupLocalAudio();
270
270
  this.emit('callStopped');
271
271
  }
272
272
  this.emit('reconnected');
@@ -595,6 +595,33 @@ class AStackCSRClient extends eventemitter3.EventEmitter {
595
595
  timestamp: Date.now()
596
596
  }));
597
597
  }
598
+ cleanupLocalAudio() {
599
+ if (this.imageCaptureInterval) {
600
+ clearInterval(this.imageCaptureInterval);
601
+ this.imageCaptureInterval = null;
602
+ }
603
+ if (this.videoRef) {
604
+ this.videoRef.srcObject = null;
605
+ this.videoRef = null;
606
+ }
607
+ if (this.mediaStream) {
608
+ this.mediaStream.getTracks().forEach(track => track.stop());
609
+ this.mediaStream = null;
610
+ }
611
+ if (this.audioProcessor) {
612
+ this.audioProcessor.disconnect();
613
+ this.audioProcessor.port.onmessage = null;
614
+ this.audioProcessor = null;
615
+ }
616
+ if (this.audioContext) {
617
+ this.audioContext.close();
618
+ this.audioContext = null;
619
+ }
620
+ this.audioPlayer.clearQueue();
621
+ this.callStatus = 'idle';
622
+ this.currentBlendshapes = new Array(BLENDSHAPE_COUNT).fill(0);
623
+ this.emit('blendshapeUpdate', this.currentBlendshapes);
624
+ }
598
625
  stopCall() {
599
626
  if (this.imageCaptureInterval) {
600
627
  clearInterval(this.imageCaptureInterval);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aether-stack-dev/client-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "description": "JavaScript/TypeScript SDK for AStack video-to-video AI conversations",
6
6
  "main": "dist/index.js",