omnius 1.0.417 → 1.0.418
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/dist/index.js +1508 -1236
- package/dist/scripts/live-whisper.py +18 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -197,6 +197,19 @@ def main():
|
|
|
197
197
|
# Take the last window_seconds of audio
|
|
198
198
|
window = audio_buf[-window_samples:].copy() if len(audio_buf) > window_samples else audio_buf.copy()
|
|
199
199
|
|
|
200
|
+
# Silence gate: whisper hallucinates repetitive garbage on
|
|
201
|
+
# near-silent input (quiet mics, diluted multichannel downmixes).
|
|
202
|
+
# Skip windows with no meaningful energy instead of transcribing.
|
|
203
|
+
rms = float(np.sqrt(np.mean(window ** 2))) if len(window) else 0.0
|
|
204
|
+
peak = float(np.max(np.abs(window))) if len(window) else 0.0
|
|
205
|
+
if rms < 3e-4 or peak < 2e-3: # ~-70dB RMS: definitely silence
|
|
206
|
+
continue
|
|
207
|
+
|
|
208
|
+
# Normalize quiet-but-real audio: whisper performs much better
|
|
209
|
+
# near full scale. Cap gain at 20x so noise floors aren't blasted.
|
|
210
|
+
if peak < 0.3:
|
|
211
|
+
window = window * min(20.0, 0.9 / max(peak, 1e-4))
|
|
212
|
+
|
|
200
213
|
# Transcribe
|
|
201
214
|
try:
|
|
202
215
|
fp16 = (device == "cuda")
|
|
@@ -221,8 +234,12 @@ def main():
|
|
|
221
234
|
with buf_lock:
|
|
222
235
|
full_audio = audio_buf.copy()
|
|
223
236
|
|
|
224
|
-
if len(full_audio)
|
|
237
|
+
final_rms = float(np.sqrt(np.mean(full_audio ** 2))) if len(full_audio) else 0.0
|
|
238
|
+
if len(full_audio) >= SAMPLE_RATE and final_rms >= 3e-4:
|
|
225
239
|
try:
|
|
240
|
+
final_peak = float(np.max(np.abs(full_audio)))
|
|
241
|
+
if 0 < final_peak < 0.3:
|
|
242
|
+
full_audio = full_audio * min(20.0, 0.9 / max(final_peak, 1e-4))
|
|
226
243
|
fp16 = (device == "cuda")
|
|
227
244
|
result = model.transcribe(
|
|
228
245
|
full_audio,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.418",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.418",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED