speechrecorderng 3.11.24 → 3.11.26

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/README.md CHANGED
@@ -9,7 +9,7 @@ For backwards compatibility to server REST API v1 set the property `apiVersion:
9
9
 
10
10
  ### Install NPM package
11
11
  Speechrecorder module is available as NPM package.
12
- Add `"speechrecorderng": "3.11.23"` to the `dependencies` array property in the `package.json` file of your application. Run `npm install` to install the package.
12
+ Add `"speechrecorderng": "3.11.26"` to the `dependencies` array property in the `package.json` file of your application. Run `npm install` to install the package.
13
13
  ### Module integration
14
14
  Add SpeechRecorderNg module to 'imports' property of your `AppModule` annotation. The module main component `SpeechRecorder` should be activated by an Angular route.
15
15
 
@@ -901,6 +901,9 @@ class AudioSourceNode extends AudioWorkletNode {
901
901
  static { this.DEFAULT_BUFFER_FILL_SECONDS = 10; }
902
902
  static { this.DEFAULT_STREAM_READ_FRAME_LEN = 1024; }
903
903
  static { this.QUANTUM_FRAME_LEN = 128; }
904
+ resetPlayPositionTime() {
905
+ this._playStartTime = null;
906
+ }
904
907
  get playPositionTime() {
905
908
  let ppt = null;
906
909
  if (this._playStartTime !== null) {
@@ -2648,6 +2651,12 @@ class AudioPlayer {
2648
2651
  }
2649
2652
  return this.context;
2650
2653
  }
2654
+ _resetPlayPosition() {
2655
+ this.playStartTime = null;
2656
+ if (this.sourceAudioWorkletNode) {
2657
+ this.sourceAudioWorkletNode.resetPlayPositionTime();
2658
+ }
2659
+ }
2651
2660
  get startAction() {
2652
2661
  return this._startAction;
2653
2662
  }
@@ -5683,14 +5692,14 @@ class AudioSignal extends AudioCanvasLayerComponent {
5683
5692
  }
5684
5693
  drawPlayPosition() {
5685
5694
  if (this.markerCanvas) {
5686
- let w = this.markerCanvas.width;
5687
- let h = this.markerCanvas.height;
5688
- let g = this.markerCanvas.getContext("2d");
5695
+ const w = this.markerCanvas.width;
5696
+ const h = this.markerCanvas.height;
5697
+ const g = this.markerCanvas.getContext("2d");
5689
5698
  if (g) {
5690
5699
  g.clearRect(0, 0, w, h);
5691
- if (this._playFramePosition) {
5692
- let pixelPos = this.frameToViewPortXPixelPosition(this._playFramePosition);
5693
- if (pixelPos) {
5700
+ if (this._playFramePosition != null) {
5701
+ const pixelPos = this.frameToViewPortXPixelPosition(this._playFramePosition);
5702
+ if (pixelPos != null) {
5694
5703
  g.fillStyle = 'red';
5695
5704
  g.strokeStyle = 'red';
5696
5705
  g.beginPath();
@@ -5767,7 +5776,7 @@ class AudioSignal extends AudioCanvasLayerComponent {
5767
5776
  this.signalCanvas.style.left = Math.round(this.bounds.position.left).toString() + 'px';
5768
5777
  this.signalCanvas.width = Math.round(this.bounds.dimension.width);
5769
5778
  this.signalCanvas.height = Math.round(this.bounds.dimension.height);
5770
- let g = this.signalCanvas.getContext("2d");
5779
+ const g = this.signalCanvas.getContext("2d");
5771
5780
  if (g) {
5772
5781
  //g.clearRect(0, 0,w, h);
5773
5782
  g.fillStyle = "black";
@@ -5777,6 +5786,7 @@ class AudioSignal extends AudioCanvasLayerComponent {
5777
5786
  }
5778
5787
  this.startRender();
5779
5788
  this.drawCursorLayer();
5789
+ this.drawPlayPosition();
5780
5790
  }
5781
5791
  startRender() {
5782
5792
  if (this.worker) {
@@ -5789,24 +5799,24 @@ class AudioSignal extends AudioCanvasLayerComponent {
5789
5799
  if (this._audioDataHolder) {
5790
5800
  this._audioDataHolder.addOnReadyListener(() => {
5791
5801
  if (this._audioDataHolder && this.bounds && this.bounds.dimension) {
5792
- let w = Math.round(this.bounds.dimension.width);
5793
- let h = Math.round(this.bounds.dimension.height);
5794
- let vw = Math.round(this.virtualDimension.width);
5802
+ const w = Math.round(this.bounds.dimension.width);
5803
+ const h = Math.round(this.bounds.dimension.height);
5804
+ const vw = Math.round(this.virtualDimension.width);
5795
5805
  if (w > 0 && h > 0 && vw > 0) {
5796
5806
  //this.wo = new Worker('./audiosignal.worker.js',{type: 'module'});
5797
5807
  this.worker = new Worker(this.workerURL);
5798
5808
  //this.wo = new Worker('worker/audiosignal.worker.ts');
5799
5809
  //let Worker = require('worker!../../../workers/uploader/main');
5800
- let chs = this._audioDataHolder.numberOfChannels;
5801
- let leftPos = Math.round(this.bounds.position.left);
5810
+ const chs = this._audioDataHolder.numberOfChannels;
5811
+ const leftPos = Math.round(this.bounds.position.left);
5802
5812
  let renderPos = leftPos;
5803
- let frameLength = this._audioDataHolder.frameLen;
5804
- let framesPerPixel = Math.ceil(frameLength / vw);
5813
+ const frameLength = this._audioDataHolder.frameLen;
5814
+ const framesPerPixel = Math.ceil(frameLength / vw);
5805
5815
  //console.debug("Chs: " + chs + ", vw: " + vw + ", frameLength: " + frameLength + ", framesPerPixel: " + framesPerPixel);
5806
5816
  let ad = new Float32Array(chs * framesPerPixel);
5807
- let raAs = this._audioDataHolder.randomAccessAudioStream();
5817
+ const raAs = this._audioDataHolder.randomAccessAudioStream();
5808
5818
  let audioBuffer = null;
5809
- let audioSource = this._audioDataHolder.audioSource;
5819
+ const audioSource = this._audioDataHolder.audioSource;
5810
5820
  if (audioSource instanceof AudioBufferSource) {
5811
5821
  audioBuffer = audioSource.audioBuffer;
5812
5822
  }
@@ -5837,12 +5847,12 @@ class AudioSignal extends AudioCanvasLayerComponent {
5837
5847
  const pointsLen = chs * w;
5838
5848
  for (let ch = 0; ch < chs; ch++) {
5839
5849
  if (psMinMax) {
5840
- let rBasePos = ch * rw;
5841
- let basePos = ch * w;
5842
- let rPosMin = rBasePos;
5843
- let rPosMax = rPointsLen + rPosMin;
5844
- let posMin = basePos + (renderPos - leftPos);
5845
- let posMax = pointsLen + posMin;
5850
+ const rBasePos = ch * rw;
5851
+ const basePos = ch * w;
5852
+ const rPosMin = rBasePos;
5853
+ const rPosMax = rPointsLen + rPosMin;
5854
+ const posMin = basePos + (renderPos - leftPos);
5855
+ const posMax = pointsLen + posMin;
5846
5856
  psMinMax[posMin] = me.data.psMinMax[rPosMin];
5847
5857
  //console.debug('Min: ('+posMin+'): '+me.data.psMinMax[rPosMin]);
5848
5858
  psMinMax[posMax] = me.data.psMinMax[rPosMax];
@@ -5979,9 +5989,9 @@ class AudioSignal extends AudioCanvasLayerComponent {
5979
5989
  }
5980
5990
  else {
5981
5991
  if (this.bounds && this.bounds.dimension) {
5982
- let w = Math.round(this.bounds.dimension.width);
5983
- let h = Math.round(this.bounds.dimension.height);
5984
- let g = this.signalCanvas.getContext("2d");
5992
+ const w = Math.round(this.bounds.dimension.width);
5993
+ const h = Math.round(this.bounds.dimension.height);
5994
+ const g = this.signalCanvas.getContext("2d");
5985
5995
  if (g) {
5986
5996
  g.clearRect(0, 0, w, h);
5987
5997
  }
@@ -6009,7 +6019,7 @@ class AudioSignal extends AudioCanvasLayerComponent {
6009
6019
  let g = this.signalCanvas.getContext("2d");
6010
6020
  if (g) {
6011
6021
  g.clearRect(0, 0, w, h);
6012
- let pointsLen = w * chs;
6022
+ const pointsLen = w * chs;
6013
6023
  // one for min one for max
6014
6024
  //const arrLen = pointsLen * 2;
6015
6025
  if (this._audioDataHolder) {
@@ -6149,7 +6159,7 @@ class AudioSignal extends AudioCanvasLayerComponent {
6149
6159
  // }
6150
6160
  setData(audioData) {
6151
6161
  this._audioDataHolder = audioData;
6152
- this.playFramePosition = 0;
6162
+ this.playFramePosition = null;
6153
6163
  }
6154
6164
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: AudioSignal, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
6155
6165
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.30", type: AudioSignal, isStandalone: false, selector: "audio-signal", viewQueries: [{ propertyName: "audioSignalCanvasRef", first: true, predicate: ["audioSignal"], descendants: true, static: true }, { propertyName: "playPosCanvasRef", first: true, predicate: ["marker"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
@@ -6523,8 +6533,8 @@ class Sonagram extends AudioCanvasLayerComponent {
6523
6533
  if (g) {
6524
6534
  g.clearRect(0, 0, w, h);
6525
6535
  if (this._playFramePosition != null) {
6526
- let pixelPos = this.frameToViewPortXPixelPosition(this._playFramePosition);
6527
- if (pixelPos) {
6536
+ const pixelPos = this.frameToViewPortXPixelPosition(this._playFramePosition);
6537
+ if (pixelPos != null) {
6528
6538
  g.fillStyle = 'red';
6529
6539
  g.strokeStyle = 'red';
6530
6540
  g.beginPath();
@@ -6882,6 +6892,7 @@ class Sonagram extends AudioCanvasLayerComponent {
6882
6892
  }
6883
6893
  this.startRender();
6884
6894
  this.drawCursorLayer();
6895
+ this.drawPlayPosition();
6885
6896
  }
6886
6897
  startRender() {
6887
6898
  //console.debug("Sonagram start render...");
@@ -7295,7 +7306,7 @@ class Sonagram extends AudioCanvasLayerComponent {
7295
7306
  //
7296
7307
  setData(audioData) {
7297
7308
  this._audioDataHolder = audioData;
7298
- this.playFramePosition = 0;
7309
+ this.playFramePosition = null;
7299
7310
  }
7300
7311
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: Sonagram, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
7301
7312
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.30", type: Sonagram, isStandalone: false, selector: "audio-sonagram", viewQueries: [{ propertyName: "sonagramCanvasRef", first: true, predicate: ["sonagram"], descendants: true, static: true }, { propertyName: "markerCanvasRef", first: true, predicate: ["marker"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
@@ -13663,6 +13674,7 @@ class SessionManager extends BasicRecorder {
13663
13674
  this._displayRecFile = displayRecFile;
13664
13675
  }
13665
13676
  updateDisplayRecFile(displayRecFile, fetchAndApplyRecordingFile = true) {
13677
+ this.liveLevelDisplay.playFramePosition = null;
13666
13678
  this.displayRecFile = displayRecFile;
13667
13679
  if (this._displayRecFile) {
13668
13680
  if (this.items) {
@@ -14467,13 +14479,13 @@ class SessionManager extends BasicRecorder {
14467
14479
  [playSelectionAction]="controlAudioPlayer?.startSelectionAction"
14468
14480
  [autoPlayOnSelectToggleAction]="controlAudioPlayer?.autoPlayOnSelectToggleAction"
14469
14481
  [playStopAction]="controlAudioPlayer?.stopAction">
14470
-
14482
+
14471
14483
  </app-sprprompting>
14472
14484
  @if (screenXs) {
14473
14485
  <mat-progress-bar [value]="progressPercentValue()" ></mat-progress-bar>
14474
14486
  }
14475
-
14476
-
14487
+
14488
+
14477
14489
  <div [class]="{audioStatusDisplay:!screenXs,audioStatusDisplayXs:screenXs}">
14478
14490
  <audio-levelbar style="flex:1 0 1%" [streamingMode]="isRecording() || keepLiveLevel" [displayLevelInfos]="displayAudioClip?.levelInfos" [state]="liveLevelDisplayState"></audio-levelbar>
14479
14491
  <div style="display:flex;flex-direction: row">
@@ -14486,7 +14498,7 @@ class SessionManager extends BasicRecorder {
14486
14498
  [agc]="this.ac?.agcStatus"
14487
14499
  (onShowRecordingDetails)="audioSignalCollapsed=!audioSignalCollapsed">
14488
14500
  </spr-recordingitemcontrols>
14489
-
14501
+
14490
14502
  @if (screenXs && enableUploadRecordings) {
14491
14503
  <app-uploadstatus class="ricontrols dark" style="flex:0 0 0" [value]="uploadProgress"
14492
14504
  [status]="uploadStatus" [awaitNewUpload]="processingRecording"></app-uploadstatus>
@@ -14536,13 +14548,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
14536
14548
  [playSelectionAction]="controlAudioPlayer?.startSelectionAction"
14537
14549
  [autoPlayOnSelectToggleAction]="controlAudioPlayer?.autoPlayOnSelectToggleAction"
14538
14550
  [playStopAction]="controlAudioPlayer?.stopAction">
14539
-
14551
+
14540
14552
  </app-sprprompting>
14541
14553
  @if (screenXs) {
14542
14554
  <mat-progress-bar [value]="progressPercentValue()" ></mat-progress-bar>
14543
14555
  }
14544
-
14545
-
14556
+
14557
+
14546
14558
  <div [class]="{audioStatusDisplay:!screenXs,audioStatusDisplayXs:screenXs}">
14547
14559
  <audio-levelbar style="flex:1 0 1%" [streamingMode]="isRecording() || keepLiveLevel" [displayLevelInfos]="displayAudioClip?.levelInfos" [state]="liveLevelDisplayState"></audio-levelbar>
14548
14560
  <div style="display:flex;flex-direction: row">
@@ -14555,7 +14567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
14555
14567
  [agc]="this.ac?.agcStatus"
14556
14568
  (onShowRecordingDetails)="audioSignalCollapsed=!audioSignalCollapsed">
14557
14569
  </spr-recordingitemcontrols>
14558
-
14570
+
14559
14571
  @if (screenXs && enableUploadRecordings) {
14560
14572
  <app-uploadstatus class="ricontrols dark" style="flex:0 0 0" [value]="uploadProgress"
14561
14573
  [status]="uploadStatus" [awaitNewUpload]="processingRecording"></app-uploadstatus>
@@ -15385,6 +15397,9 @@ class AudioDisplayPlayer {
15385
15397
  if (this.ap && this.ap.playPositionFrames) {
15386
15398
  this.audioDisplayScrollPane.playFramePosition = this.ap.playPositionFrames;
15387
15399
  }
15400
+ else {
15401
+ this.audioDisplayScrollPane.playFramePosition = null;
15402
+ }
15388
15403
  }
15389
15404
  audioPlayerUpdate(e) {
15390
15405
  if (EventType.STARTED === e.type) {
@@ -16734,7 +16749,7 @@ class RecordingList {
16734
16749
  <ng-container matColumnDef="startedDate">
16735
16750
  <th mat-header-cell *matHeaderCellDef mat-header>Started</th>
16736
16751
  <td mat-cell class="monospaced"
16737
- *matCellDef="let element">{{element.startedDate | date:'YYYY-MM-dd HH:mm:ss'}}</td>
16752
+ *matCellDef="let element">{{element.startedDate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
16738
16753
  </ng-container>
16739
16754
  <ng-container matColumnDef="length">
16740
16755
  <th mat-header-cell *matHeaderCellDef mat-header>Length</th>
@@ -16782,7 +16797,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
16782
16797
  <ng-container matColumnDef="startedDate">
16783
16798
  <th mat-header-cell *matHeaderCellDef mat-header>Started</th>
16784
16799
  <td mat-cell class="monospaced"
16785
- *matCellDef="let element">{{element.startedDate | date:'YYYY-MM-dd HH:mm:ss'}}</td>
16800
+ *matCellDef="let element">{{element.startedDate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
16786
16801
  </ng-container>
16787
16802
  <ng-container matColumnDef="length">
16788
16803
  <th mat-header-cell *matHeaderCellDef mat-header>Length</th>
@@ -17236,6 +17251,7 @@ class AudioRecorder extends BasicRecorder {
17236
17251
  }
17237
17252
  set displayRecFile(displayRecFile) {
17238
17253
  //this.audioLoaded=false;
17254
+ this.liveLevelDisplay.playFramePosition = null;
17239
17255
  this._displayRecFile = displayRecFile;
17240
17256
  if (this._displayRecFile) {
17241
17257
  let adh = this._displayRecFile.audioDataHolder;
@@ -17745,8 +17761,11 @@ class AudioRecorder extends BasicRecorder {
17745
17761
  const ppFrames = this._controlAudioPlayer.playPositionFrames;
17746
17762
  if (ppFrames !== null) {
17747
17763
  this.recorderCombiPane.audioDisplay.playFramePosition = ppFrames;
17748
- this.liveLevelDisplay.playFramePosition = ppFrames;
17749
17764
  }
17765
+ this.liveLevelDisplay.playFramePosition = ppFrames;
17766
+ }
17767
+ else {
17768
+ this.liveLevelDisplay.playFramePosition = null;
17750
17769
  }
17751
17770
  }
17752
17771
  audioPlayerUpdate(e) {
@@ -17759,6 +17778,7 @@ class AudioRecorder extends BasicRecorder {
17759
17778
  else if (EventType.ENDED === e.type) {
17760
17779
  //.status='Ready.';
17761
17780
  window.clearInterval(this.updateTimerId);
17781
+ this.updateControlPlaybackPosition();
17762
17782
  }
17763
17783
  if (!this.destroyed) {
17764
17784
  this.changeDetectorRef.detectChanges();
@@ -18109,7 +18129,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
18109
18129
  exports: [MessageDialog, SpeechrecorderngComponent, ScrollPaneHorizontal, AudioClipUIContainer, AudioDisplayScrollPane, AudioDisplay, AudioDisplayPlayer, AudioDisplayControl, LevelBar, AudioRecorder], imports: [RouterModule.forChild(SPR_ROUTES), CommonModule, MatIconModule, MatButtonModule, MatDialogModule, MatProgressBarModule, MatProgressSpinnerModule, MatTooltipModule, MatCheckboxModule, MatCardModule, MatDividerModule, MatGridListModule, MatTableModule, MatInputModule, MatSelectModule, MatSnackBarModule, MatMenuModule, IntersectionObserverDirective], providers: [SessionService, ProjectService, ScriptService, RecordingService, RecordingFileService, SpeechRecorderUploader, provideHttpClient(withInterceptorsFromDi())] }]
18110
18130
  }] });
18111
18131
 
18112
- const VERSION = '3.11.24';
18132
+ const VERSION = '3.11.26';
18113
18133
 
18114
18134
  const SPEECHRECORDER_ENVIRONMENT_DEFAULTS = {
18115
18135
  production: false,