neverlib 0.2.8__py3-none-any.whl → 0.3.0__py3-none-any.whl
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.
- neverlib/Docs/audio_aug/test_volume.ipynb +8 -8
- neverlib/Docs/filter/biquad.ipynb +1 -1
- neverlib/Docs/filter/filter_family.ipynb +4 -4
- neverlib/Docs/vad/VAD_WebRTC.ipynb +4 -4
- neverlib/Docs/vad/VAD_whisper.ipynb +2 -2
- neverlib/LLM/__init__.py +37 -0
- neverlib/LLM/bailian.py +342 -0
- neverlib/LLM/image.py +73 -0
- neverlib/LLM/text.py +32 -0
- neverlib/QA/ImpactNoiseRejection.py +119 -0
- neverlib/QA/gen_init.py +13 -16
- neverlib/__init__.py +5 -5
- neverlib/audio_aug/HarmonicDistortion.py +11 -11
- neverlib/audio_aug/README.md +3 -0
- neverlib/audio_aug/__init__.py +2 -2
- neverlib/audio_aug/audio_aug.py +18 -18
- neverlib/audio_aug/coder_aug.py +25 -25
- neverlib/audio_aug/coder_aug2.py +10 -10
- neverlib/audio_aug/loss_packet_aug.py +16 -16
- neverlib/audio_aug/quant_aug.py +7 -7
- neverlib/data_analyze/README.md +1 -1
- neverlib/data_analyze/__init__.py +2 -2
- neverlib/data_analyze/dataset_analyzer.py +2 -2
- neverlib/data_analyze/quality_metrics.py +12 -12
- neverlib/data_analyze/statistics.py +1 -1
- neverlib/data_analyze/visualization.py +1 -1
- neverlib/filter/README.md +3 -3
- neverlib/filter/__init__.py +2 -2
- neverlib/filter/auto_eq/README.md +2 -2
- neverlib/filter/auto_eq/__init__.py +2 -2
- neverlib/filter/auto_eq/de_eq.py +1 -1
- neverlib/filter/auto_eq/ga_eq_advanced.py +2 -2
- neverlib/filter/auto_eq/ga_eq_basic.py +1 -1
- neverlib/filter/biquad.py +1 -1
- neverlib/filter/core.py +8 -5
- neverlib/metrics/README.md +35 -0
- neverlib/metrics/__init__.py +2 -2
- neverlib/metrics/dnsmos.py +2 -2
- neverlib/metrics/lpc_lsp.py +8 -8
- neverlib/metrics/pesq_c/PESQ +0 -0
- neverlib/metrics/snr.py +5 -5
- neverlib/metrics/spec.py +23 -23
- neverlib/metrics/test_pesq.py +3 -3
- neverlib/signal_gen/babble_noise_generate.py +113 -0
- neverlib/tests/__init__.py +2 -2
- neverlib/tests/test_imports.py +1 -1
- neverlib/utils/README.md +29 -0
- neverlib/utils/__init__.py +24 -16
- neverlib/utils/audio_split.py +21 -21
- neverlib/utils/checkGPU.py +52 -79
- neverlib/utils/floder.py +115 -0
- neverlib/utils/lazy_expose.py +1 -1
- neverlib/utils/lazy_module.py +6 -6
- neverlib/utils/message.py +2 -3
- neverlib/utils/pcm.py +42 -0
- neverlib/utils/utils.py +108 -91
- neverlib/vad/README.md +5 -5
- neverlib/vad/__init__.py +2 -2
- neverlib/vad/utils.py +1 -1
- {neverlib-0.2.8.dist-info → neverlib-0.3.0.dist-info}/METADATA +17 -3
- neverlib-0.3.0.dist-info/RECORD +120 -0
- neverlib/.claude/settings.local.json +0 -9
- neverlib/.history/Docs/audio_aug/del_20250827162530.py +0 -0
- neverlib/.history/Docs/audio_aug/del_20250827162540.py +0 -2
- neverlib/.history/Docs/audio_aug/del_20250827162541.py +0 -7
- neverlib/.history/Docs/audio_aug/del_20250827162606.py +0 -7
- neverlib/.history/Docs/audio_aug/del_20250827162637.py +0 -8
- neverlib/.history/Docs/audio_aug/del_20250827162645.py +0 -8
- neverlib/.history/Docs/audio_aug/del_20250827162723.py +0 -9
- neverlib/.history/Docs/audio_aug/del_20250827162739.py +0 -9
- neverlib/.history/Docs/audio_aug/test_snr_20250806011311.py +0 -0
- neverlib/.history/Docs/audio_aug/test_snr_20250806011331.py +0 -75
- neverlib/.history/Docs/audio_aug/test_snr_20250806011342.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250806011352.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250806011403.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250806011413.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250806011435.py +0 -55
- neverlib/.history/Docs/audio_aug/test_snr_20250827161751.py +0 -55
- neverlib/.history/Docs/audio_aug/test_snr_20250827161754.py +0 -55
- neverlib/.history/Docs/audio_aug/test_snr_20250827161833.py +0 -54
- neverlib/.history/Docs/audio_aug/test_snr_20250827162017.py +0 -56
- neverlib/.history/Docs/audio_aug/test_snr_20250827162021.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250827162028.py +0 -57
- neverlib/.history/Docs/audio_aug/test_snr_20250827162033.py +0 -55
- neverlib/.history/Docs/audio_aug_test/del_20250827162738.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162819.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162830.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162846.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162851.py +0 -9
- neverlib/.history/Docs/audio_aug_test/del_20250827162903.py +0 -10
- neverlib/.history/Docs/audio_aug_test/del_20250827162921.py +0 -10
- neverlib/.history/Docs/audio_aug_test/del_20250827162926.py +0 -10
- neverlib/.history/Docs/audio_aug_test/del_20250827163030.py +0 -10
- neverlib/.history/Docs/audio_aug_test/del_20250827163032.py +0 -10
- neverlib/.history/Docs/vad/1_20250810032405.py +0 -0
- neverlib/.history/Docs/vad/1_20250810032417.py +0 -39
- neverlib/.history/QA/html2markdown_20250822234112.md +0 -0
- neverlib/.history/QA/html2markdown_20250822234140.py +0 -9
- neverlib/.history/QA/html2markdown_20250822234141.md +0 -9
- neverlib/.history/QA/html2markdown_20250822234159.py +0 -12
- neverlib/.history/QA/html2markdown_20250822234200.py +0 -17
- neverlib/.history/QA/html2markdown_20250822234236.py +0 -17
- neverlib/.history/QA/html2markdown_20250822234340.py +0 -14
- neverlib/.history/QA/html2markdown_20250822234522.py +0 -18
- neverlib/.history/QA/html2markdown_20250822234601.py +0 -20
- neverlib/.history/QA/html2markdown_20250822234615.py +0 -22
- neverlib/.history/QA/html2markdown_20250822234715.py +0 -28
- neverlib/.history/QA/html2markdown_20250822234720.py +0 -27
- neverlib/.history/QA/html2markdown_20250822234903.py +0 -27
- neverlib/.history/__init___20250805234212.py +0 -41
- neverlib/.history/__init___20250904102635.py +0 -39
- neverlib/.history/__init___20250904102836.py +0 -34
- neverlib/.history/__init___20250904102838.py +0 -39
- neverlib/.history/__init___20250904102851.py +0 -33
- neverlib/.history/audio_aug/audio_aug_20250806010451.py +0 -125
- neverlib/.history/audio_aug/audio_aug_20250806010750.py +0 -138
- neverlib/.history/audio_aug/audio_aug_20250806010759.py +0 -140
- neverlib/.history/audio_aug/audio_aug_20250806010803.py +0 -140
- neverlib/.history/audio_aug/audio_aug_20250806010809.py +0 -140
- neverlib/.history/audio_aug/audio_aug_20250806011108.py +0 -140
- neverlib/.history/audio_aug/audio_aug_20250826155913.py +0 -158
- neverlib/.history/audio_aug/audio_aug_20250826164159.py +0 -159
- neverlib/.history/audio_aug/audio_aug_20250826164217.py +0 -160
- neverlib/.history/audio_aug/audio_aug_20250826164408.py +0 -161
- neverlib/.history/audio_aug/audio_aug_20250826164423.py +0 -161
- neverlib/.history/audio_aug/audio_aug_20250826164529.py +0 -161
- neverlib/.history/audio_aug/audio_aug_20250826164824.py +0 -161
- neverlib/.history/audio_aug/audio_aug_20250826164932.py +0 -162
- neverlib/.history/audio_aug/audio_aug_20250826164947.py +0 -162
- neverlib/.history/audio_aug/audio_aug_20250826165403.py +0 -162
- neverlib/.history/audio_aug/audio_aug_20250826165421.py +0 -162
- neverlib/.history/audio_aug/audio_aug_20250826165509.py +0 -163
- neverlib/.history/audio_aug/audio_aug_20250826165702.py +0 -163
- neverlib/.history/audio_aug/audio_aug_20250826165732.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826170041.py +0 -163
- neverlib/.history/audio_aug/audio_aug_20250826170105.py +0 -164
- neverlib/.history/audio_aug/audio_aug_20250826170154.py +0 -164
- neverlib/.history/audio_aug/audio_aug_20250826170220.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826170221.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826170228.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826170231.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826212001.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220038.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220133.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220148.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220154.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220156.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220314.py +0 -165
- neverlib/.history/audio_aug/audio_aug_20250826220343.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220345.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220349.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220429.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220447.py +0 -184
- neverlib/.history/audio_aug/audio_aug_20250826220601.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220638.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220641.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220647.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220653.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220655.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220731.py +0 -185
- neverlib/.history/audio_aug/audio_aug_20250826220739.py +0 -185
- neverlib/.history/audio_aug/audio_aug_20250826220747.py +0 -185
- neverlib/.history/audio_aug/audio_aug_20250826220801.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220822.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826220901.py +0 -186
- neverlib/.history/audio_aug/audio_aug_20250826221107.py +0 -187
- neverlib/.history/audio_aug/audio_aug_20250826221310.py +0 -188
- neverlib/.history/audio_aug/audio_aug_20250826221353.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221821.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221838.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221906.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221930.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221939.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826221955.py +0 -191
- neverlib/.history/audio_aug/audio_aug_20250826222008.py +0 -197
- neverlib/.history/audio_aug/audio_aug_20250826222017.py +0 -200
- neverlib/.history/audio_aug/audio_aug_20250826222046.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222105.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222206.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222302.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222336.py +0 -203
- neverlib/.history/audio_aug/audio_aug_20250826222455.py +0 -204
- neverlib/.history/audio_aug/audio_aug_20250826222526.py +0 -204
- neverlib/.history/audio_aug/audio_aug_20250826222541.py +0 -204
- neverlib/.history/audio_aug/audio_aug_20250826222624.py +0 -202
- neverlib/.history/audio_aug/audio_aug_20250826222714.py +0 -205
- neverlib/.history/audio_aug/audio_aug_20250826222820.py +0 -205
- neverlib/.history/audio_aug/audio_aug_20250826222827.py +0 -205
- neverlib/.history/audio_aug/audio_aug_20250826222927.py +0 -232
- neverlib/.history/audio_aug/audio_aug_20250826223009.py +0 -232
- neverlib/.history/audio_aug/audio_aug_20250826223054.py +0 -232
- neverlib/.history/audio_aug/audio_aug_20250826223225.py +0 -233
- neverlib/.history/audio_aug/audio_aug_20250826223344.py +0 -236
- neverlib/.history/audio_aug/audio_aug_20250826223356.py +0 -236
- neverlib/.history/audio_aug/audio_aug_20250826223955.py +0 -242
- neverlib/.history/audio_aug/audio_aug_20250826224210.py +0 -240
- neverlib/.history/audio_aug/audio_aug_20250826224250.py +0 -242
- neverlib/.history/audio_aug/audio_aug_20250826224323.py +0 -280
- neverlib/.history/audio_aug/audio_aug_20250826224452.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224455.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224502.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224528.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224658.py +0 -263
- neverlib/.history/audio_aug/audio_aug_20250826224833.py +0 -264
- neverlib/.history/audio_aug/audio_aug_20250826225013.py +0 -269
- neverlib/.history/audio_aug/audio_aug_20250826225050.py +0 -269
- neverlib/.history/audio_aug/audio_aug_20250826225241.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250826225315.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826225404.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826225502.py +0 -265
- neverlib/.history/audio_aug/audio_aug_20250826225950.py +0 -267
- neverlib/.history/audio_aug/audio_aug_20250826225959.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250826230222.py +0 -271
- neverlib/.history/audio_aug/audio_aug_20250826230248.py +0 -270
- neverlib/.history/audio_aug/audio_aug_20250826230638.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826230755.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826230941.py +0 -265
- neverlib/.history/audio_aug/audio_aug_20250826231054.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826231117.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826231219.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826232330.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250826232352.py +0 -266
- neverlib/.history/audio_aug/audio_aug_20250827152748.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250827152806.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250827152808.py +0 -268
- neverlib/.history/audio_aug/audio_aug_20250827152917.py +0 -283
- neverlib/.history/audio_aug/audio_aug_20250827152929.py +0 -281
- neverlib/.history/audio_aug/audio_aug_20250827153100.py +0 -286
- neverlib/.history/audio_aug/audio_aug_20250827153102.py +0 -286
- neverlib/.history/audio_aug/audio_aug_20250827153301.py +0 -295
- neverlib/.history/audio_aug/audio_aug_20250827153331.py +0 -298
- neverlib/.history/audio_aug/audio_aug_20250827153525.py +0 -303
- neverlib/.history/audio_aug/audio_aug_20250827153533.py +0 -304
- neverlib/.history/audio_aug/audio_aug_20250827153541.py +0 -321
- neverlib/.history/audio_aug/audio_aug_20250827153805.py +0 -322
- neverlib/.history/audio_aug/audio_aug_20250827153832.py +0 -323
- neverlib/.history/audio_aug/audio_aug_20250827153836.py +0 -324
- neverlib/.history/audio_aug/audio_aug_20250827153846.py +0 -324
- neverlib/.history/audio_aug/audio_aug_20250827153859.py +0 -325
- neverlib/.history/audio_aug/audio_aug_20250827154453.py +0 -337
- neverlib/.history/audio_aug/audio_aug_20250827154513.py +0 -355
- neverlib/.history/audio_aug/audio_aug_20250827154538.py +0 -356
- neverlib/.history/audio_aug/audio_aug_20250827154541.py +0 -357
- neverlib/.history/audio_aug/audio_aug_20250827154612.py +0 -357
- neverlib/.history/audio_aug/audio_aug_20250827154657.py +0 -360
- neverlib/.history/audio_aug/audio_aug_20250827154708.py +0 -360
- neverlib/.history/audio_aug/audio_aug_20250827154728.py +0 -366
- neverlib/.history/audio_aug/audio_aug_20250827154755.py +0 -367
- neverlib/.history/audio_aug/audio_aug_20250827154800.py +0 -367
- neverlib/.history/audio_aug/audio_aug_20250827154917.py +0 -368
- neverlib/.history/audio_aug/audio_aug_20250827154928.py +0 -369
- neverlib/.history/audio_aug/audio_aug_20250827154932.py +0 -370
- neverlib/.history/audio_aug/audio_aug_20250827154947.py +0 -372
- neverlib/.history/audio_aug/audio_aug_20250827155015.py +0 -375
- neverlib/.history/audio_aug/audio_aug_20250827155106.py +0 -375
- neverlib/.history/audio_aug/audio_aug_20250827155114.py +0 -393
- neverlib/.history/audio_aug/audio_aug_20250827155207.py +0 -415
- neverlib/.history/audio_aug/audio_aug_20250827155300.py +0 -415
- neverlib/.history/audio_aug/audio_aug_20250827155321.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827164703.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827164749.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827165252.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827165334.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827165404.py +0 -473
- neverlib/.history/audio_aug/audio_aug_20250827165610.py +0 -473
- neverlib/.history/audio_aug/audio_aug_20250827165805.py +0 -473
- neverlib/.history/audio_aug/audio_aug_20250827170056.py +0 -473
- neverlib/.history/audio_aug/audio_aug_20250827170106.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827170143.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827170216.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827170218.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827170314.py +0 -472
- neverlib/.history/audio_aug/audio_aug_20250827171500.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827172347.py +0 -471
- neverlib/.history/audio_aug/audio_aug_20250827172558.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827172559.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827172801.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827182522.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827182526.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827182626.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250827182715.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250904185444.py +0 -470
- neverlib/.history/audio_aug/audio_aug_20250904185538.py +0 -445
- neverlib/.history/dataAnalyze/__init___20250805234204.py +0 -87
- neverlib/.history/dataAnalyze/__init___20250806204125.py +0 -14
- neverlib/.history/dataAnalyze/__init___20250806204139.py +0 -14
- neverlib/.history/dataAnalyze/__init___20250806204159.py +0 -14
- neverlib/.history/data_analyze/__init___20250806204158.py +0 -14
- neverlib/.history/data_analyze/__init___20250827163248.py +0 -14
- neverlib/.history/filter/__init___20250820103351.py +0 -70
- neverlib/.history/filter/__init___20250821102348.py +0 -70
- neverlib/.history/filter/__init___20250821102405.py +0 -14
- neverlib/.history/filter/auto_eq/__init___20250819213121.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102241.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102259.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102307.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102310.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102318.py +0 -36
- neverlib/.history/filter/auto_eq/__init___20250821102507.py +0 -36
- neverlib/.history/filter/auto_eq/de_eq_20250820103848.py +0 -361
- neverlib/.history/filter/auto_eq/de_eq_20250821102422.py +0 -360
- neverlib/.history/filter/auto_eq/freq_eq_20250805234206.py +0 -75
- neverlib/.history/filter/auto_eq/freq_eq_20250820140732.py +0 -75
- neverlib/.history/filter/auto_eq/freq_eq_20250820140745.py +0 -75
- neverlib/.history/filter/auto_eq/freq_eq_20250820140816.py +0 -75
- neverlib/.history/filter/auto_eq/freq_eq_20250820140938.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141003.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141006.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141019.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141049.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141211.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141227.py +0 -77
- neverlib/.history/filter/auto_eq/freq_eq_20250820141311.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250820141340.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250820141712.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250820141733.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250820141755.py +0 -78
- neverlib/.history/filter/auto_eq/freq_eq_20250821102434.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821102500.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821102502.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821143140.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821153208.py +0 -76
- neverlib/.history/filter/auto_eq/freq_eq_20250821153214.py +0 -76
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820102957.py +0 -380
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820113054.py +0 -380
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820113150.py +0 -380
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820113520.py +0 -385
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250820113525.py +0 -385
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250821102212.py +0 -385
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250901110521.py +0 -385
- neverlib/.history/filter/auto_eq/ga_eq_basic_20250901110652.py +0 -385
- neverlib/.history/filter/common_20250806002134.py +0 -37
- neverlib/.history/filter/common_20250821120448.py +0 -49
- neverlib/.history/filter/common_20250821120453.py +0 -49
- neverlib/.history/metrics/dnsmos_20250806001612.py +0 -160
- neverlib/.history/metrics/dnsmos_20250815180659.py +0 -160
- neverlib/.history/metrics/dnsmos_20250815180701.py +0 -158
- neverlib/.history/metrics/dnsmos_20250815181321.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181327.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181331.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181620.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181631.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181742.py +0 -154
- neverlib/.history/metrics/dnsmos_20250815181824.py +0 -153
- neverlib/.history/metrics/dnsmos_20250815181834.py +0 -153
- neverlib/.history/metrics/dnsmos_20250815181922.py +0 -153
- neverlib/.history/metrics/dnsmos_20250815182011.py +0 -147
- neverlib/.history/metrics/dnsmos_20250815182036.py +0 -144
- neverlib/.history/metrics/dnsmos_20250815182936.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815182942.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815183032.py +0 -137
- neverlib/.history/metrics/dnsmos_20250815183101.py +0 -144
- neverlib/.history/metrics/dnsmos_20250815183121.py +0 -144
- neverlib/.history/metrics/dnsmos_20250815183123.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815183214.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815183240.py +0 -143
- neverlib/.history/metrics/dnsmos_20250815183248.py +0 -144
- neverlib/.history/metrics/dnsmos_20250815183407.py +0 -142
- neverlib/.history/metrics/dnsmos_20250815183409.py +0 -142
- neverlib/.history/metrics/dnsmos_20250815183431.py +0 -142
- neverlib/.history/metrics/dnsmos_20250815183507.py +0 -140
- neverlib/.history/metrics/dnsmos_20250815183513.py +0 -139
- neverlib/.history/metrics/dnsmos_20250815183618.py +0 -139
- neverlib/.history/metrics/dnsmos_20250815183709.py +0 -140
- neverlib/.history/metrics/dnsmos_20250815183756.py +0 -137
- neverlib/.history/metrics/dnsmos_20250815183815.py +0 -128
- neverlib/.history/metrics/dnsmos_20250815183827.py +0 -129
- neverlib/.history/metrics/dnsmos_20250815183913.py +0 -117
- neverlib/.history/metrics/dnsmos_20250815183914.py +0 -117
- neverlib/.history/metrics/dnsmos_20250815184003.py +0 -118
- neverlib/.history/metrics/dnsmos_20250815184040.py +0 -118
- neverlib/.history/metrics/dnsmos_20250815184049.py +0 -118
- neverlib/.history/metrics/dnsmos_20250815184104.py +0 -117
- neverlib/.history/metrics/dnsmos_20250815184200.py +0 -117
- neverlib/.history/metrics/lpc_lsp_metric_20250816015944.py +0 -128
- neverlib/.history/metrics/lpc_lsp_metric_20250816020142.py +0 -128
- neverlib/.history/metrics/lpc_lsp_metric_20250816020156.py +0 -128
- neverlib/.history/metrics/lpc_lsp_metric_20250816020554.py +0 -130
- neverlib/.history/metrics/lpc_lsp_metric_20250816020600.py +0 -125
- neverlib/.history/metrics/lpc_lsp_metric_20250816020631.py +0 -120
- neverlib/.history/metrics/lpc_lsp_metric_20250816020746.py +0 -118
- neverlib/.history/metrics/lpc_me_20250816013111.py +0 -0
- neverlib/.history/metrics/lpc_me_20250816013129.py +0 -121
- neverlib/.history/metrics/lpc_me_20250816015430.py +0 -103
- neverlib/.history/metrics/lpc_me_20250816015535.py +0 -96
- neverlib/.history/metrics/lpc_me_20250816015542.py +0 -96
- neverlib/.history/metrics/lpc_me_20250816015636.py +0 -97
- neverlib/.history/metrics/lpc_me_20250816015658.py +0 -104
- neverlib/.history/metrics/lpc_me_20250816015703.py +0 -100
- neverlib/.history/metrics/lpc_me_20250816015945.py +0 -128
- neverlib/.history/metrics/snr_20250806010538.py +0 -177
- neverlib/.history/metrics/snr_20250806211634.py +0 -184
- neverlib/.history/metrics/snr_20250827224201.py +0 -182
- neverlib/.history/metrics/snr_20250827234019.py +0 -186
- neverlib/.history/metrics/snr_20250827234028.py +0 -186
- neverlib/.history/metrics/snr_20250827234030.py +0 -186
- neverlib/.history/metrics/spec_20250805234209.py +0 -45
- neverlib/.history/metrics/spec_20250816135530.py +0 -11
- neverlib/.history/metrics/spec_20250816135654.py +0 -16
- neverlib/.history/metrics/spec_20250816135736.py +0 -68
- neverlib/.history/metrics/spec_20250816135904.py +0 -75
- neverlib/.history/metrics/spec_20250816135921.py +0 -82
- neverlib/.history/metrics/spec_20250816140111.py +0 -82
- neverlib/.history/metrics/spec_20250816140543.py +0 -136
- neverlib/.history/metrics/spec_20250816140559.py +0 -172
- neverlib/.history/metrics/spec_20250816140602.py +0 -172
- neverlib/.history/metrics/spec_20250816140608.py +0 -172
- neverlib/.history/metrics/spec_20250816140654.py +0 -148
- neverlib/.history/metrics/spec_20250816140705.py +0 -144
- neverlib/.history/metrics/spec_20250816140755.py +0 -138
- neverlib/.history/metrics/spec_20250816140823.py +0 -170
- neverlib/.history/metrics/spec_20250816140832.py +0 -170
- neverlib/.history/metrics/spec_20250816140833.py +0 -170
- neverlib/.history/metrics/spec_20250816140922.py +0 -147
- neverlib/.history/metrics/spec_20250816141148.py +0 -107
- neverlib/.history/metrics/spec_20250816141219.py +0 -123
- neverlib/.history/metrics/spec_20250816141732.py +0 -178
- neverlib/.history/metrics/spec_20250816141740.py +0 -178
- neverlib/.history/metrics/spec_20250816142030.py +0 -178
- neverlib/.history/metrics/spec_20250816142107.py +0 -135
- neverlib/.history/metrics/spec_20250816142126.py +0 -135
- neverlib/.history/metrics/spec_20250816142410.py +0 -135
- neverlib/.history/metrics/spec_20250816142415.py +0 -136
- neverlib/.history/metrics/spec_metric_20250816135156.py +0 -0
- neverlib/.history/metrics/spec_metric_20250816135226.py +0 -5
- neverlib/.history/metrics/spec_metric_20250816135227.py +0 -10
- neverlib/.history/metrics/spec_metric_20250816135306.py +0 -15
- neverlib/.history/metrics/spec_metric_20250816135442.py +0 -31
- neverlib/.history/metrics/spec_metric_20250816135448.py +0 -31
- neverlib/.history/metrics/spec_metric_20250816135520.py +0 -29
- neverlib/.history/metrics/spec_metric_20250816135537.py +0 -63
- neverlib/.history/metrics/spec_metric_20250816135653.py +0 -65
- neverlib/.history/utils/audio_split_20250805234209.py +0 -268
- neverlib/.history/utils/audio_split_20250904185309.py +0 -268
- neverlib/.history/utils/utils_20250813165516.py +0 -330
- neverlib/.history/utils/utils_20250904181341.py +0 -328
- neverlib/.history/utils/utils_20250904185546.py +0 -352
- neverlib/.history/utils/utils_20250904185548.py +0 -353
- neverlib/.history/utils/utils_20250904185603.py +0 -353
- neverlib/.history/utils/utils_20250904185636.py +0 -353
- neverlib/.history/utils/utils_20250904185658.py +0 -358
- neverlib/.history/utils/utils_20250904190053.py +0 -359
- neverlib/.history/vad/PreProcess_20250805234211.py +0 -63
- neverlib/.history/vad/PreProcess_20250809232455.py +0 -63
- neverlib/.history/vad/PreProcess_20250816020725.py +0 -66
- neverlib/.history/vad/VAD_Silero_20250805234211.py +0 -50
- neverlib/.history/vad/VAD_Silero_20250809232456.py +0 -50
- neverlib/.history/vad/VAD_WebRTC_20250805234211.py +0 -61
- neverlib/.history/vad/VAD_WebRTC_20250809232456.py +0 -61
- neverlib/.history/vad/VAD_funasr_20250805234211.py +0 -54
- neverlib/.history/vad/VAD_funasr_20250809232456.py +0 -54
- neverlib/.history/vad/VAD_vadlib_20250805234211.py +0 -70
- neverlib/.history/vad/VAD_vadlib_20250809232455.py +0 -70
- neverlib/.history/vad/VAD_whisper_20250805234211.py +0 -55
- neverlib/.history/vad/VAD_whisper_20250809232456.py +0 -55
- neverlib/.specstory/.what-is-this.md +0 -69
- neverlib/.specstory/history/2025-08-05_17-06Z-/350/277/231/344/270/200/346/255/245/347/232/204/347/233/256/347/232/204/346/230/257/344/273/200/344/271/210.md +0 -424
- neverlib/.specstory/history/2025-08-22_02-10Z-/345/256/214/345/226/204/345/207/275/346/225/260/347/232/204/345/212/237/350/203/275/345/222/214/345/217/230/351/207/217/345/220/215/345/273/272/350/256/256.md +0 -247
- neverlib/.specstory/history/2025-08-26_11-54Z-oserror-missing-shared-object-file.md +0 -87
- neverlib/.specstory/history/2025-08-27_08-07Z-/345/256/214/345/226/204/346/265/213/350/257/225/346/226/207/346/241/243/347/232/204/350/256/250/350/256/272.md +0 -296
- neverlib/.specstory/history/2025-08-27_08-29Z-delete-python-file-command.md +0 -211
- neverlib/.specstory/history/2025-08-27_09-05Z-/345/234/250jupyter/344/270/255/346/222/255/346/224/276/351/237/263/351/242/221/347/232/204/344/273/243/347/240/201/344/277/256/346/224/271.md +0 -357
- neverlib-0.2.8.dist-info/RECORD +0 -510
- {neverlib-0.2.8.dist-info → neverlib-0.3.0.dist-info}/WHEEL +0 -0
- {neverlib-0.2.8.dist-info → neverlib-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {neverlib-0.2.8.dist-info → neverlib-0.3.0.dist-info}/top_level.txt +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# -*- coding:utf-8 -*-
|
|
2
|
-
# Author:凌逆战 | Never
|
|
3
|
-
# Date: 2024/9/19
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class WebRTC_VAD_C():
|
|
11
|
-
def __init__(self, sr=16000, window_len=10, mode=1):
|
|
12
|
-
"""
|
|
13
|
-
:param window_len: 窗长(ms)
|
|
14
|
-
:param mode:
|
|
15
|
-
"""
|
|
16
|
-
import webrtcvad
|
|
17
|
-
self.sr = sr
|
|
18
|
-
self.vad = webrtcvad.Vad()
|
|
19
|
-
self.vad.set_mode(mode) # 0~3
|
|
20
|
-
self.window_len = int(window_len / 1000 * sr)
|
|
21
|
-
|
|
22
|
-
def process(self, wav):
|
|
23
|
-
assert wav.ndim == 1, f"wav shape为{wav.shape}, 期望1D"
|
|
24
|
-
# float32 -> int16
|
|
25
|
-
wav_int16 = (wav * np.iinfo(np.int16).max).astype(np.int16)
|
|
26
|
-
wav_int16 = wav_int16[:len(wav_int16) - len(wav_int16) % self.window_len] # (105120, 1)
|
|
27
|
-
vad_array = np.zeros_like(wav_int16)
|
|
28
|
-
for i in range(0, len(wav_int16), self.window_len):
|
|
29
|
-
vad_flag = self.vad.is_speech(wav_int16[i:i + self.window_len].tobytes(), self.sr)
|
|
30
|
-
vad_array[i:i + self.window_len] = vad_flag
|
|
31
|
-
|
|
32
|
-
return vad_array
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if __name__ == "__main__":
|
|
36
|
-
import soundfile as sf
|
|
37
|
-
import matplotlib.pyplot as plt
|
|
38
|
-
from neverlib.vad.PreProcess import HPFilter, volume_norm
|
|
39
|
-
|
|
40
|
-
sr = 16000
|
|
41
|
-
wav_path = "../../data/vad_example.wav"
|
|
42
|
-
wav, wav_sr = sf.read(wav_path, always_2d=False, dtype="float32")
|
|
43
|
-
assert wav_sr == sr, f"音频采样率为{wav_sr}, 期望{sr}"
|
|
44
|
-
wav = HPFilter(wav, sr=sr, order=6, cutoff=100)
|
|
45
|
-
wav = volume_norm(wav)
|
|
46
|
-
|
|
47
|
-
vad = WebRTC_VAD_C()
|
|
48
|
-
vad_array = vad.process(wav)
|
|
49
|
-
|
|
50
|
-
plt.figure(figsize=(20, 5))
|
|
51
|
-
plt.plot(wav)
|
|
52
|
-
plt.plot(vad_array)
|
|
53
|
-
plt.grid()
|
|
54
|
-
plt.show()
|
|
55
|
-
|
|
56
|
-
plt.figure(figsize=(20, 5))
|
|
57
|
-
plt.subplot(2, 1, 1)
|
|
58
|
-
plt.specgram(wav, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
59
|
-
plt.subplot(2, 1, 2)
|
|
60
|
-
plt.specgram(vad_array, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
61
|
-
plt.show()
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# -*- coding:utf-8 -*-
|
|
2
|
-
# Author:凌逆战 | Never
|
|
3
|
-
# Date: 2024/9/19
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class WebRTC_VAD_C():
|
|
11
|
-
def __init__(self, sr=16000, window_len=10, mode=1):
|
|
12
|
-
"""
|
|
13
|
-
:param window_len: 窗长(ms)
|
|
14
|
-
:param mode:
|
|
15
|
-
"""
|
|
16
|
-
import webrtcvad
|
|
17
|
-
self.sr = sr
|
|
18
|
-
self.vad = webrtcvad.Vad()
|
|
19
|
-
self.vad.set_mode(mode) # 0~3
|
|
20
|
-
self.window_len = int(window_len / 1000 * sr)
|
|
21
|
-
|
|
22
|
-
def process(self, wav):
|
|
23
|
-
assert wav.ndim == 1, f"wav shape为{wav.shape}, 期望1D"
|
|
24
|
-
# float32 -> int16
|
|
25
|
-
wav_int16 = (wav * np.iinfo(np.int16).max).astype(np.int16)
|
|
26
|
-
wav_int16 = wav_int16[:len(wav_int16) - len(wav_int16) % self.window_len] # (105120, 1)
|
|
27
|
-
vad_array = np.zeros_like(wav_int16)
|
|
28
|
-
for i in range(0, len(wav_int16), self.window_len):
|
|
29
|
-
vad_flag = self.vad.is_speech(wav_int16[i:i + self.window_len].tobytes(), self.sr)
|
|
30
|
-
vad_array[i:i + self.window_len] = vad_flag
|
|
31
|
-
|
|
32
|
-
return vad_array
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if __name__ == "__main__":
|
|
36
|
-
import soundfile as sf
|
|
37
|
-
import matplotlib.pyplot as plt
|
|
38
|
-
from neverlib.vad.PreProcess import HPFilter, volume_norm
|
|
39
|
-
|
|
40
|
-
sr = 16000
|
|
41
|
-
wav_path = "../../data/vad_example.wav"
|
|
42
|
-
wav, wav_sr = sf.read(wav_path, always_2d=False, dtype="float32")
|
|
43
|
-
assert wav_sr == sr, f"音频采样率为{wav_sr}, 期望{sr}"
|
|
44
|
-
wav = HPFilter(wav, sr=sr, order=6, cutoff=100)
|
|
45
|
-
wav = volume_norm(wav)
|
|
46
|
-
|
|
47
|
-
vad = WebRTC_VAD_C()
|
|
48
|
-
vad_array = vad.process(wav)
|
|
49
|
-
|
|
50
|
-
plt.figure(figsize=(20, 5))
|
|
51
|
-
plt.plot(wav)
|
|
52
|
-
plt.plot(vad_array)
|
|
53
|
-
plt.grid()
|
|
54
|
-
plt.show()
|
|
55
|
-
|
|
56
|
-
plt.figure(figsize=(20, 5))
|
|
57
|
-
plt.subplot(2, 1, 1)
|
|
58
|
-
plt.specgram(wav, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
59
|
-
plt.subplot(2, 1, 2)
|
|
60
|
-
plt.specgram(vad_array, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
61
|
-
plt.show()
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# -*- coding:utf-8 -*-
|
|
2
|
-
# Author:凌逆战 | Never
|
|
3
|
-
# Date: 2024/9/19
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class FunASR_VAD_C():
|
|
11
|
-
def __init__(self, sr=16000):
|
|
12
|
-
from funasr import AutoModel
|
|
13
|
-
self.sr = sr
|
|
14
|
-
self.model = AutoModel(model="fsmn-vad", model_revision="v2.0.4")
|
|
15
|
-
|
|
16
|
-
def process(self, wav):
|
|
17
|
-
assert wav.ndim == 1, f"wav shape为{wav.shape}, 期望1D"
|
|
18
|
-
res_list = self.model.generate(input=wav)
|
|
19
|
-
vad_array = np.zeros_like(wav)
|
|
20
|
-
for res in res_list:
|
|
21
|
-
for value_item in res["value"]:
|
|
22
|
-
beg, end = value_item
|
|
23
|
-
vad_array[int(beg * self.sr / 1000):int(end * self.sr / 1000)] = 1
|
|
24
|
-
|
|
25
|
-
return vad_array
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if __name__ == "__main__":
|
|
29
|
-
import soundfile as sf
|
|
30
|
-
import matplotlib.pyplot as plt
|
|
31
|
-
from neverlib.vad.PreProcess import HPFilter, volume_norm
|
|
32
|
-
|
|
33
|
-
sr = 16000
|
|
34
|
-
wav_path = "../../data/vad_example.wav"
|
|
35
|
-
wav, wav_sr = sf.read(wav_path, always_2d=False, dtype="float32")
|
|
36
|
-
assert wav_sr == sr, f"音频采样率为{wav_sr}, 期望{sr}"
|
|
37
|
-
wav = HPFilter(wav, sr=sr, order=6, cutoff=100)
|
|
38
|
-
wav = volume_norm(wav)
|
|
39
|
-
|
|
40
|
-
vad = FunASR_VAD_C()
|
|
41
|
-
vad_array = vad.process(wav)
|
|
42
|
-
|
|
43
|
-
plt.figure(figsize=(20, 5))
|
|
44
|
-
plt.plot(wav)
|
|
45
|
-
plt.plot(vad_array)
|
|
46
|
-
plt.grid()
|
|
47
|
-
plt.show()
|
|
48
|
-
|
|
49
|
-
plt.figure(figsize=(20, 5))
|
|
50
|
-
plt.subplot(2, 1, 1)
|
|
51
|
-
plt.specgram(wav, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
52
|
-
plt.subplot(2, 1, 2)
|
|
53
|
-
plt.specgram(vad_array, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
54
|
-
plt.show()
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# -*- coding:utf-8 -*-
|
|
2
|
-
# Author:凌逆战 | Never
|
|
3
|
-
# Date: 2024/9/19
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class FunASR_VAD_C():
|
|
11
|
-
def __init__(self, sr=16000):
|
|
12
|
-
from funasr import AutoModel
|
|
13
|
-
self.sr = sr
|
|
14
|
-
self.model = AutoModel(model="fsmn-vad", model_revision="v2.0.4")
|
|
15
|
-
|
|
16
|
-
def process(self, wav):
|
|
17
|
-
assert wav.ndim == 1, f"wav shape为{wav.shape}, 期望1D"
|
|
18
|
-
res_list = self.model.generate(input=wav)
|
|
19
|
-
vad_array = np.zeros_like(wav)
|
|
20
|
-
for res in res_list:
|
|
21
|
-
for value_item in res["value"]:
|
|
22
|
-
beg, end = value_item
|
|
23
|
-
vad_array[int(beg * self.sr / 1000):int(end * self.sr / 1000)] = 1
|
|
24
|
-
|
|
25
|
-
return vad_array
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if __name__ == "__main__":
|
|
29
|
-
import soundfile as sf
|
|
30
|
-
import matplotlib.pyplot as plt
|
|
31
|
-
from neverlib.vad.PreProcess import HPFilter, volume_norm
|
|
32
|
-
|
|
33
|
-
sr = 16000
|
|
34
|
-
wav_path = "../../data/vad_example.wav"
|
|
35
|
-
wav, wav_sr = sf.read(wav_path, always_2d=False, dtype="float32")
|
|
36
|
-
assert wav_sr == sr, f"音频采样率为{wav_sr}, 期望{sr}"
|
|
37
|
-
wav = HPFilter(wav, sr=sr, order=6, cutoff=100)
|
|
38
|
-
wav = volume_norm(wav)
|
|
39
|
-
|
|
40
|
-
vad = FunASR_VAD_C()
|
|
41
|
-
vad_array = vad.process(wav)
|
|
42
|
-
|
|
43
|
-
plt.figure(figsize=(20, 5))
|
|
44
|
-
plt.plot(wav)
|
|
45
|
-
plt.plot(vad_array)
|
|
46
|
-
plt.grid()
|
|
47
|
-
plt.show()
|
|
48
|
-
|
|
49
|
-
plt.figure(figsize=(20, 5))
|
|
50
|
-
plt.subplot(2, 1, 1)
|
|
51
|
-
plt.specgram(wav, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
52
|
-
plt.subplot(2, 1, 2)
|
|
53
|
-
plt.specgram(vad_array, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
54
|
-
plt.show()
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# -*- coding:utf-8 -*-
|
|
2
|
-
# Author:凌逆战 | Never
|
|
3
|
-
# Date: 2024/9/19
|
|
4
|
-
"""
|
|
5
|
-
基于能量的VAD
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Vadlib_C():
|
|
11
|
-
def __init__(self, sr=16000, frame_length=20, frame_shift=20,
|
|
12
|
-
energy_threshold=0.05, pre_emphasis=0.95):
|
|
13
|
-
"""
|
|
14
|
-
:param sr: 采样率
|
|
15
|
-
:param frame_length: 帧长(ms)
|
|
16
|
-
:param frame_shift: 帧移(ms)
|
|
17
|
-
:param energy_threshold: 能量阈值
|
|
18
|
-
:param pre_emphasis: 预加重系数
|
|
19
|
-
"""
|
|
20
|
-
from vad import EnergyVAD
|
|
21
|
-
self.sr = sr
|
|
22
|
-
self.vad = EnergyVAD(
|
|
23
|
-
sample_rate=sr,
|
|
24
|
-
frame_length=frame_length,
|
|
25
|
-
frame_shift=frame_shift,
|
|
26
|
-
energy_threshold=energy_threshold,
|
|
27
|
-
pre_emphasis=pre_emphasis,
|
|
28
|
-
)
|
|
29
|
-
self.frame_length = frame_length
|
|
30
|
-
|
|
31
|
-
def process(self, wav):
|
|
32
|
-
assert wav.ndim == 1, f"wav shape为{wav.shape}, 期望1D"
|
|
33
|
-
# 返回布尔阵列, 指示框架是否是语音
|
|
34
|
-
voice_activity = self.vad(wav) # (115,) [1,1,0,0,1,,1,0,0....]
|
|
35
|
-
|
|
36
|
-
window_len = int(self.frame_length / 1000 * self.sr)
|
|
37
|
-
vad_array = np.zeros_like(wav)
|
|
38
|
-
for i in range(len(voice_activity)):
|
|
39
|
-
if voice_activity[i]:
|
|
40
|
-
vad_array[i * window_len: (i + 1) * window_len] = 1
|
|
41
|
-
return vad_array
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if __name__ == "__main__":
|
|
45
|
-
import soundfile as sf
|
|
46
|
-
import matplotlib.pyplot as plt
|
|
47
|
-
from neverlib.vad.PreProcess import HPFilter, volume_norm
|
|
48
|
-
|
|
49
|
-
sr = 16000
|
|
50
|
-
wav_path = "../../data/vad_example.wav"
|
|
51
|
-
wav, wav_sr = sf.read(wav_path, always_2d=False, dtype="float32")
|
|
52
|
-
assert wav_sr == sr, f"音频采样率为{wav_sr}, 期望{sr}"
|
|
53
|
-
wav = HPFilter(wav, sr=sr, order=6, cutoff=100)
|
|
54
|
-
wav = volume_norm(wav)
|
|
55
|
-
|
|
56
|
-
vad = Vadlib_C()
|
|
57
|
-
vad_array = vad.process(wav)
|
|
58
|
-
|
|
59
|
-
plt.figure(figsize=(20, 5))
|
|
60
|
-
plt.plot(wav)
|
|
61
|
-
plt.plot(vad_array)
|
|
62
|
-
plt.grid()
|
|
63
|
-
plt.show()
|
|
64
|
-
|
|
65
|
-
plt.figure(figsize=(20, 5))
|
|
66
|
-
plt.subplot(2, 1, 1)
|
|
67
|
-
plt.specgram(wav, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
68
|
-
plt.subplot(2, 1, 2)
|
|
69
|
-
plt.specgram(vad_array, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
70
|
-
plt.show()
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# -*- coding:utf-8 -*-
|
|
2
|
-
# Author:凌逆战 | Never
|
|
3
|
-
# Date: 2024/9/19
|
|
4
|
-
"""
|
|
5
|
-
基于能量的VAD
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Vadlib_C():
|
|
11
|
-
def __init__(self, sr=16000, frame_length=20, frame_shift=20,
|
|
12
|
-
energy_threshold=0.05, pre_emphasis=0.95):
|
|
13
|
-
"""
|
|
14
|
-
:param sr: 采样率
|
|
15
|
-
:param frame_length: 帧长(ms)
|
|
16
|
-
:param frame_shift: 帧移(ms)
|
|
17
|
-
:param energy_threshold: 能量阈值
|
|
18
|
-
:param pre_emphasis: 预加重系数
|
|
19
|
-
"""
|
|
20
|
-
from vad import EnergyVAD
|
|
21
|
-
self.sr = sr
|
|
22
|
-
self.vad = EnergyVAD(
|
|
23
|
-
sample_rate=sr,
|
|
24
|
-
frame_length=frame_length,
|
|
25
|
-
frame_shift=frame_shift,
|
|
26
|
-
energy_threshold=energy_threshold,
|
|
27
|
-
pre_emphasis=pre_emphasis,
|
|
28
|
-
)
|
|
29
|
-
self.frame_length = frame_length
|
|
30
|
-
|
|
31
|
-
def process(self, wav):
|
|
32
|
-
assert wav.ndim == 1, f"wav shape为{wav.shape}, 期望1D"
|
|
33
|
-
# 返回布尔阵列, 指示框架是否是语音
|
|
34
|
-
voice_activity = self.vad(wav) # (115,) [1,1,0,0,1,,1,0,0....]
|
|
35
|
-
|
|
36
|
-
window_len = int(self.frame_length / 1000 * self.sr)
|
|
37
|
-
vad_array = np.zeros_like(wav)
|
|
38
|
-
for i in range(len(voice_activity)):
|
|
39
|
-
if voice_activity[i]:
|
|
40
|
-
vad_array[i * window_len: (i + 1) * window_len] = 1
|
|
41
|
-
return vad_array
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if __name__ == "__main__":
|
|
45
|
-
import soundfile as sf
|
|
46
|
-
import matplotlib.pyplot as plt
|
|
47
|
-
from neverlib.vad.PreProcess import HPFilter, volume_norm
|
|
48
|
-
|
|
49
|
-
sr = 16000
|
|
50
|
-
wav_path = "../../data/vad_example.wav"
|
|
51
|
-
wav, wav_sr = sf.read(wav_path, always_2d=False, dtype="float32")
|
|
52
|
-
assert wav_sr == sr, f"音频采样率为{wav_sr}, 期望{sr}"
|
|
53
|
-
wav = HPFilter(wav, sr=sr, order=6, cutoff=100)
|
|
54
|
-
wav = volume_norm(wav)
|
|
55
|
-
|
|
56
|
-
vad = Vadlib_C()
|
|
57
|
-
vad_array = vad.process(wav)
|
|
58
|
-
|
|
59
|
-
plt.figure(figsize=(20, 5))
|
|
60
|
-
plt.plot(wav)
|
|
61
|
-
plt.plot(vad_array)
|
|
62
|
-
plt.grid()
|
|
63
|
-
plt.show()
|
|
64
|
-
|
|
65
|
-
plt.figure(figsize=(20, 5))
|
|
66
|
-
plt.subplot(2, 1, 1)
|
|
67
|
-
plt.specgram(wav, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
68
|
-
plt.subplot(2, 1, 2)
|
|
69
|
-
plt.specgram(vad_array, Fs=sr, scale_by_freq=True, sides='default', cmap="jet")
|
|
70
|
-
plt.show()
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# -*- coding:utf-8 -*-
|
|
2
|
-
# Author:凌逆战 | Never
|
|
3
|
-
# Date: 2024/9/19
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Whisper_VAD_C():
|
|
11
|
-
def __init__(self, sr=16000, mode="base"):
|
|
12
|
-
"""
|
|
13
|
-
:param mode: "base"、"large-v3"
|
|
14
|
-
"""
|
|
15
|
-
import whisper
|
|
16
|
-
self.sr=16000
|
|
17
|
-
self.model = whisper.load_model(mode)
|
|
18
|
-
|
|
19
|
-
def process(self, wav):
|
|
20
|
-
assert wav.ndim == 1, f"wav shape为{wav.shape}, 期望1D"
|
|
21
|
-
result = self.model.transcribe(wav, word_timestamps=True)
|
|
22
|
-
|
|
23
|
-
timestamps = []
|
|
24
|
-
for segment in result['segments']:
|
|
25
|
-
# print(f"Segment: {segment['text']}")
|
|
26
|
-
# 句级别时间戳
|
|
27
|
-
# start_time, end_time = segment['start'], segment['end']
|
|
28
|
-
# print(f"Start: {start_time:.3f}s, End: {end_time:.3f}s") # Start: 0.00s, End: 2.80s
|
|
29
|
-
# 词级别时间戳
|
|
30
|
-
for word_info in segment['words']:
|
|
31
|
-
# word = word_info['word']
|
|
32
|
-
start_time = word_info['start']
|
|
33
|
-
end_time = word_info['end']
|
|
34
|
-
timestamps.append({"start": int(start_time * self.sr), "end": int(end_time * self.sr)})
|
|
35
|
-
# print(f"Word: {word}, Start: {start_time:.2f}s, End: {end_time:.2f}s")
|
|
36
|
-
return timestamps
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if __name__ == "__main__":
|
|
41
|
-
import soundfile as sf
|
|
42
|
-
import matplotlib.pyplot as plt
|
|
43
|
-
from neverlib.vad.PreProcess import HPFilter, volume_norm
|
|
44
|
-
|
|
45
|
-
sr = 16000
|
|
46
|
-
wav_path = "../../data/vad_example.wav"
|
|
47
|
-
wav, wav_sr = sf.read(wav_path, always_2d=False, dtype="float32")
|
|
48
|
-
assert wav_sr == sr, f"音频采样率为{wav_sr}, 期望{sr}"
|
|
49
|
-
wav = HPFilter(wav, sr=sr, order=6, cutoff=100)
|
|
50
|
-
wav = volume_norm(wav)
|
|
51
|
-
|
|
52
|
-
vad = Whisper_VAD_C()
|
|
53
|
-
timestamps = vad.process(wav)
|
|
54
|
-
|
|
55
|
-
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# -*- coding:utf-8 -*-
|
|
2
|
-
# Author:凌逆战 | Never
|
|
3
|
-
# Date: 2024/9/19
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Whisper_VAD_C():
|
|
11
|
-
def __init__(self, sr=16000, mode="base"):
|
|
12
|
-
"""
|
|
13
|
-
:param mode: "base"、"large-v3"
|
|
14
|
-
"""
|
|
15
|
-
import whisper
|
|
16
|
-
self.sr=16000
|
|
17
|
-
self.model = whisper.load_model(mode)
|
|
18
|
-
|
|
19
|
-
def process(self, wav):
|
|
20
|
-
assert wav.ndim == 1, f"wav shape为{wav.shape}, 期望1D"
|
|
21
|
-
result = self.model.transcribe(wav, word_timestamps=True)
|
|
22
|
-
|
|
23
|
-
timestamps = []
|
|
24
|
-
for segment in result['segments']:
|
|
25
|
-
# print(f"Segment: {segment['text']}")
|
|
26
|
-
# 句级别时间戳
|
|
27
|
-
# start_time, end_time = segment['start'], segment['end']
|
|
28
|
-
# print(f"Start: {start_time:.3f}s, End: {end_time:.3f}s") # Start: 0.00s, End: 2.80s
|
|
29
|
-
# 词级别时间戳
|
|
30
|
-
for word_info in segment['words']:
|
|
31
|
-
# word = word_info['word']
|
|
32
|
-
start_time = word_info['start']
|
|
33
|
-
end_time = word_info['end']
|
|
34
|
-
timestamps.append({"start": int(start_time * self.sr), "end": int(end_time * self.sr)})
|
|
35
|
-
# print(f"Word: {word}, Start: {start_time:.2f}s, End: {end_time:.2f}s")
|
|
36
|
-
return timestamps
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if __name__ == "__main__":
|
|
41
|
-
import soundfile as sf
|
|
42
|
-
import matplotlib.pyplot as plt
|
|
43
|
-
from neverlib.vad.PreProcess import HPFilter, volume_norm
|
|
44
|
-
|
|
45
|
-
sr = 16000
|
|
46
|
-
wav_path = "../../data/vad_example.wav"
|
|
47
|
-
wav, wav_sr = sf.read(wav_path, always_2d=False, dtype="float32")
|
|
48
|
-
assert wav_sr == sr, f"音频采样率为{wav_sr}, 期望{sr}"
|
|
49
|
-
wav = HPFilter(wav, sr=sr, order=6, cutoff=100)
|
|
50
|
-
wav = volume_norm(wav)
|
|
51
|
-
|
|
52
|
-
vad = Whisper_VAD_C()
|
|
53
|
-
timestamps = vad.process(wav)
|
|
54
|
-
|
|
55
|
-
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# SpecStory Artifacts Directory
|
|
2
|
-
|
|
3
|
-
This directory is automatically created and maintained by the SpecStory extension to preserve your AI chat history.
|
|
4
|
-
|
|
5
|
-
## What's Here?
|
|
6
|
-
|
|
7
|
-
- `.specstory/history`: Contains auto-saved markdown files of your AI coding sessions
|
|
8
|
-
- Each file represents a separate AI chat session
|
|
9
|
-
- If you enable auto-save, files are automatically updated as you work
|
|
10
|
-
- You can enable/disable the auto-save feature in the SpecStory settings, it is disabled by default
|
|
11
|
-
- `.specstory/.project.json`: Contains the persistent project identity for the current workspace
|
|
12
|
-
- This file is only present if you enable AI rules derivation
|
|
13
|
-
- This is used to provide consistent project identity of your project, even as the workspace is moved or renamed
|
|
14
|
-
- `.specstory/ai_rules_backups`: Contains backups of the `.cursor/rules/derived-cursor-rules.mdc` or the `.github/copilot-instructions.md` file
|
|
15
|
-
- Backups are automatically created each time the `.cursor/rules/derived-cursor-rules.mdc` or the `.github/copilot-instructions.md` file is updated
|
|
16
|
-
- You can enable/disable the AI Rules derivation feature in the SpecStory settings, it is disabled by default
|
|
17
|
-
- `.specstory/.gitignore`: Contains directives to exclude non-essential contents of the `.specstory` directory from version control
|
|
18
|
-
- Add `/history` to exclude the auto-saved chat history from version control
|
|
19
|
-
|
|
20
|
-
## Valuable Uses
|
|
21
|
-
|
|
22
|
-
- Capture: Keep your context window up-to-date when starting new Chat/Composer sessions via @ references
|
|
23
|
-
- Search: For previous prompts and code snippets
|
|
24
|
-
- Learn: Meta-analyze your patterns and learn from your past experiences
|
|
25
|
-
- Derive: Keep the AI on course with your past decisions by automatically deriving rules from your AI interactions
|
|
26
|
-
|
|
27
|
-
## Version Control
|
|
28
|
-
|
|
29
|
-
We recommend keeping this directory under version control to maintain a history of your AI interactions. However, if you prefer not to version these files, you can exclude them by adding this to your `.gitignore`:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
.specstory/**
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
We recommend __not__ keeping the `.specstory/ai_rules_backups` directory under version control if you are already using git to version your AI rules, and committing regularly. You can exclude it by adding this to your `.gitignore`:
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
.specstory/ai_rules_backups
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Searching Your Codebase
|
|
42
|
-
|
|
43
|
-
When searching your codebase, search results may include your previous AI coding interactions. To focus solely on your actual code files, you can exclude the AI interaction history from search results.
|
|
44
|
-
|
|
45
|
-
To exclude AI interaction history:
|
|
46
|
-
|
|
47
|
-
1. Open the "Find in Files" search in Cursor or VSCode (Cmd/Ctrl + Shift + F)
|
|
48
|
-
2. Navigate to the "files to exclude" section
|
|
49
|
-
3. Add the following pattern:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
.specstory/*
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
This will ensure your searches only return results from your working codebase files.
|
|
56
|
-
|
|
57
|
-
## Notes
|
|
58
|
-
|
|
59
|
-
- Auto-save only works when Cursor or VSCode flushes sqlite database data to disk. This results in a small delay after the AI response is complete before SpecStory can save the history.
|
|
60
|
-
|
|
61
|
-
## Settings
|
|
62
|
-
|
|
63
|
-
You can control auto-saving behavior in Cursor or VSCode:
|
|
64
|
-
|
|
65
|
-
1. Open Cursor/Code → Settings → VS Code Settings (Cmd/Ctrl + ,)
|
|
66
|
-
2. Search for "SpecStory"
|
|
67
|
-
3. Find "Auto Save" setting to enable/disable
|
|
68
|
-
|
|
69
|
-
Auto-save occurs when changes are detected in the sqlite database, or every 2 minutes as a safety net.
|