@hivegpt/hiveai-angular 0.0.578 → 0.0.580
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/bundles/hivegpt-hiveai-angular.umd.js +7 -5
- package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/voice-agent/components/voice-agent-modal/voice-agent-modal.component.js +3 -3
- package/esm2015/lib/components/voice-agent/services/audio-analyzer.service.js +6 -4
- package/fesm2015/hivegpt-hiveai-angular.js +7 -5
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/lib/components/voice-agent/components/voice-agent-modal/voice-agent-modal.component.d.ts +1 -1
- package/lib/components/voice-agent/services/audio-analyzer.service.d.ts +1 -0
- package/lib/components/voice-agent/services/audio-analyzer.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1236,6 +1236,8 @@
|
|
|
1236
1236
|
this.NOISE_FLOOR_SAMPLE_COUNT = 30;
|
|
1237
1237
|
this.SPEAKING_THRESHOLD_MULTIPLIER = 2.5;
|
|
1238
1238
|
this.WAVEFORM_BAR_COUNT = 40;
|
|
1239
|
+
// Amplify raw amplitude so normal speech (±10–20 units) maps to visible levels
|
|
1240
|
+
this.SENSITIVITY_MULTIPLIER = 5;
|
|
1239
1241
|
this.audioLevels$ = this.audioLevelsSubject.asObservable();
|
|
1240
1242
|
this.isUserSpeaking$ = this.isUserSpeakingSubject.asObservable();
|
|
1241
1243
|
}
|
|
@@ -1248,7 +1250,7 @@
|
|
|
1248
1250
|
var source = this.audioContext.createMediaStreamSource(stream);
|
|
1249
1251
|
this.analyserNode = this.audioContext.createAnalyser();
|
|
1250
1252
|
this.analyserNode.fftSize = 2048;
|
|
1251
|
-
this.analyserNode.smoothingTimeConstant = 0.
|
|
1253
|
+
this.analyserNode.smoothingTimeConstant = 0.4;
|
|
1252
1254
|
var bufferLength = this.analyserNode.frequencyBinCount;
|
|
1253
1255
|
this.dataArray = new Uint8Array(bufferLength);
|
|
1254
1256
|
source.connect(this.analyserNode);
|
|
@@ -1324,8 +1326,8 @@
|
|
|
1324
1326
|
for (var i = 0; i < this.WAVEFORM_BAR_COUNT; i++) {
|
|
1325
1327
|
var index = i * step;
|
|
1326
1328
|
var value = data[index];
|
|
1327
|
-
// Normalize
|
|
1328
|
-
var normalized = Math.abs((value - 128) / 128) * 100;
|
|
1329
|
+
// Normalize and amplify so quiet speech produces visible movement
|
|
1330
|
+
var normalized = Math.abs((value - 128) / 128) * 100 * this.SENSITIVITY_MULTIPLIER;
|
|
1329
1331
|
bars.push(Math.min(100, Math.max(0, normalized)));
|
|
1330
1332
|
}
|
|
1331
1333
|
return bars;
|
|
@@ -2183,10 +2185,10 @@
|
|
|
2183
2185
|
VoiceAgentModalComponent.prototype.toggleMic = function () {
|
|
2184
2186
|
this.voiceAgentService.toggleMic();
|
|
2185
2187
|
};
|
|
2186
|
-
/** Map audio level (0–100) to waveform bar height in px (
|
|
2188
|
+
/** Map audio level (0–100) to waveform bar height in px (4–40). */
|
|
2187
2189
|
VoiceAgentModalComponent.prototype.getWaveformHeight = function (level) {
|
|
2188
2190
|
var n = Math.min(100, Math.max(0, level !== null && level !== void 0 ? level : 0));
|
|
2189
|
-
return
|
|
2191
|
+
return 4 + (n / 100) * 36;
|
|
2190
2192
|
};
|
|
2191
2193
|
Object.defineProperty(VoiceAgentModalComponent.prototype, "statusLabel", {
|
|
2192
2194
|
/** Status label for active call. */
|