speechrecorderng 3.11.25 → 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 +1 -1
- package/fesm2022/speechrecorderng.mjs +33 -31
- package/fesm2022/speechrecorderng.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
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.
|
|
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
|
|
|
@@ -5692,14 +5692,14 @@ class AudioSignal extends AudioCanvasLayerComponent {
|
|
|
5692
5692
|
}
|
|
5693
5693
|
drawPlayPosition() {
|
|
5694
5694
|
if (this.markerCanvas) {
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5695
|
+
const w = this.markerCanvas.width;
|
|
5696
|
+
const h = this.markerCanvas.height;
|
|
5697
|
+
const g = this.markerCanvas.getContext("2d");
|
|
5698
5698
|
if (g) {
|
|
5699
5699
|
g.clearRect(0, 0, w, h);
|
|
5700
|
-
if (this._playFramePosition) {
|
|
5701
|
-
|
|
5702
|
-
if (pixelPos) {
|
|
5700
|
+
if (this._playFramePosition != null) {
|
|
5701
|
+
const pixelPos = this.frameToViewPortXPixelPosition(this._playFramePosition);
|
|
5702
|
+
if (pixelPos != null) {
|
|
5703
5703
|
g.fillStyle = 'red';
|
|
5704
5704
|
g.strokeStyle = 'red';
|
|
5705
5705
|
g.beginPath();
|
|
@@ -5776,7 +5776,7 @@ class AudioSignal extends AudioCanvasLayerComponent {
|
|
|
5776
5776
|
this.signalCanvas.style.left = Math.round(this.bounds.position.left).toString() + 'px';
|
|
5777
5777
|
this.signalCanvas.width = Math.round(this.bounds.dimension.width);
|
|
5778
5778
|
this.signalCanvas.height = Math.round(this.bounds.dimension.height);
|
|
5779
|
-
|
|
5779
|
+
const g = this.signalCanvas.getContext("2d");
|
|
5780
5780
|
if (g) {
|
|
5781
5781
|
//g.clearRect(0, 0,w, h);
|
|
5782
5782
|
g.fillStyle = "black";
|
|
@@ -5786,6 +5786,7 @@ class AudioSignal extends AudioCanvasLayerComponent {
|
|
|
5786
5786
|
}
|
|
5787
5787
|
this.startRender();
|
|
5788
5788
|
this.drawCursorLayer();
|
|
5789
|
+
this.drawPlayPosition();
|
|
5789
5790
|
}
|
|
5790
5791
|
startRender() {
|
|
5791
5792
|
if (this.worker) {
|
|
@@ -5798,24 +5799,24 @@ class AudioSignal extends AudioCanvasLayerComponent {
|
|
|
5798
5799
|
if (this._audioDataHolder) {
|
|
5799
5800
|
this._audioDataHolder.addOnReadyListener(() => {
|
|
5800
5801
|
if (this._audioDataHolder && this.bounds && this.bounds.dimension) {
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
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);
|
|
5804
5805
|
if (w > 0 && h > 0 && vw > 0) {
|
|
5805
5806
|
//this.wo = new Worker('./audiosignal.worker.js',{type: 'module'});
|
|
5806
5807
|
this.worker = new Worker(this.workerURL);
|
|
5807
5808
|
//this.wo = new Worker('worker/audiosignal.worker.ts');
|
|
5808
5809
|
//let Worker = require('worker!../../../workers/uploader/main');
|
|
5809
|
-
|
|
5810
|
-
|
|
5810
|
+
const chs = this._audioDataHolder.numberOfChannels;
|
|
5811
|
+
const leftPos = Math.round(this.bounds.position.left);
|
|
5811
5812
|
let renderPos = leftPos;
|
|
5812
|
-
|
|
5813
|
-
|
|
5813
|
+
const frameLength = this._audioDataHolder.frameLen;
|
|
5814
|
+
const framesPerPixel = Math.ceil(frameLength / vw);
|
|
5814
5815
|
//console.debug("Chs: " + chs + ", vw: " + vw + ", frameLength: " + frameLength + ", framesPerPixel: " + framesPerPixel);
|
|
5815
5816
|
let ad = new Float32Array(chs * framesPerPixel);
|
|
5816
|
-
|
|
5817
|
+
const raAs = this._audioDataHolder.randomAccessAudioStream();
|
|
5817
5818
|
let audioBuffer = null;
|
|
5818
|
-
|
|
5819
|
+
const audioSource = this._audioDataHolder.audioSource;
|
|
5819
5820
|
if (audioSource instanceof AudioBufferSource) {
|
|
5820
5821
|
audioBuffer = audioSource.audioBuffer;
|
|
5821
5822
|
}
|
|
@@ -5846,12 +5847,12 @@ class AudioSignal extends AudioCanvasLayerComponent {
|
|
|
5846
5847
|
const pointsLen = chs * w;
|
|
5847
5848
|
for (let ch = 0; ch < chs; ch++) {
|
|
5848
5849
|
if (psMinMax) {
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
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;
|
|
5855
5856
|
psMinMax[posMin] = me.data.psMinMax[rPosMin];
|
|
5856
5857
|
//console.debug('Min: ('+posMin+'): '+me.data.psMinMax[rPosMin]);
|
|
5857
5858
|
psMinMax[posMax] = me.data.psMinMax[rPosMax];
|
|
@@ -5988,9 +5989,9 @@ class AudioSignal extends AudioCanvasLayerComponent {
|
|
|
5988
5989
|
}
|
|
5989
5990
|
else {
|
|
5990
5991
|
if (this.bounds && this.bounds.dimension) {
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
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");
|
|
5994
5995
|
if (g) {
|
|
5995
5996
|
g.clearRect(0, 0, w, h);
|
|
5996
5997
|
}
|
|
@@ -6018,7 +6019,7 @@ class AudioSignal extends AudioCanvasLayerComponent {
|
|
|
6018
6019
|
let g = this.signalCanvas.getContext("2d");
|
|
6019
6020
|
if (g) {
|
|
6020
6021
|
g.clearRect(0, 0, w, h);
|
|
6021
|
-
|
|
6022
|
+
const pointsLen = w * chs;
|
|
6022
6023
|
// one for min one for max
|
|
6023
6024
|
//const arrLen = pointsLen * 2;
|
|
6024
6025
|
if (this._audioDataHolder) {
|
|
@@ -6158,7 +6159,7 @@ class AudioSignal extends AudioCanvasLayerComponent {
|
|
|
6158
6159
|
// }
|
|
6159
6160
|
setData(audioData) {
|
|
6160
6161
|
this._audioDataHolder = audioData;
|
|
6161
|
-
this.playFramePosition =
|
|
6162
|
+
this.playFramePosition = null;
|
|
6162
6163
|
}
|
|
6163
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 }); }
|
|
6164
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: `
|
|
@@ -6532,8 +6533,8 @@ class Sonagram extends AudioCanvasLayerComponent {
|
|
|
6532
6533
|
if (g) {
|
|
6533
6534
|
g.clearRect(0, 0, w, h);
|
|
6534
6535
|
if (this._playFramePosition != null) {
|
|
6535
|
-
|
|
6536
|
-
if (pixelPos) {
|
|
6536
|
+
const pixelPos = this.frameToViewPortXPixelPosition(this._playFramePosition);
|
|
6537
|
+
if (pixelPos != null) {
|
|
6537
6538
|
g.fillStyle = 'red';
|
|
6538
6539
|
g.strokeStyle = 'red';
|
|
6539
6540
|
g.beginPath();
|
|
@@ -6891,6 +6892,7 @@ class Sonagram extends AudioCanvasLayerComponent {
|
|
|
6891
6892
|
}
|
|
6892
6893
|
this.startRender();
|
|
6893
6894
|
this.drawCursorLayer();
|
|
6895
|
+
this.drawPlayPosition();
|
|
6894
6896
|
}
|
|
6895
6897
|
startRender() {
|
|
6896
6898
|
//console.debug("Sonagram start render...");
|
|
@@ -7304,7 +7306,7 @@ class Sonagram extends AudioCanvasLayerComponent {
|
|
|
7304
7306
|
//
|
|
7305
7307
|
setData(audioData) {
|
|
7306
7308
|
this._audioDataHolder = audioData;
|
|
7307
|
-
this.playFramePosition =
|
|
7309
|
+
this.playFramePosition = null;
|
|
7308
7310
|
}
|
|
7309
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 }); }
|
|
7310
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: `
|
|
@@ -18127,7 +18129,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
|
|
|
18127
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())] }]
|
|
18128
18130
|
}] });
|
|
18129
18131
|
|
|
18130
|
-
const VERSION = '3.11.
|
|
18132
|
+
const VERSION = '3.11.26';
|
|
18131
18133
|
|
|
18132
18134
|
const SPEECHRECORDER_ENVIRONMENT_DEFAULTS = {
|
|
18133
18135
|
production: false,
|