neverlib 0.2.1__py3-none-any.whl → 0.2.2__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.
@@ -9,7 +9,7 @@ import subprocess
9
9
  from tqdm import tqdm
10
10
  import soundfile as sf
11
11
  import numpy as np
12
- from utils import get_path_list
12
+ from .utils import get_path_list
13
13
  from pydub import AudioSegment
14
14
 
15
15
 
@@ -81,6 +81,7 @@ def audio_split_np(source_path, target_path, sr, channel_num, duration, endwith=
81
81
  :param duration: 分割的时长 (秒)
82
82
  :param endwith: 音频格式 (支持 pcm)
83
83
  """
84
+ assert endwith == "*.pcm", "只支持pcm格式的音频"
84
85
  wav_path_list = get_path_list(source_path, end=endwith) # 获取音频文件列表
85
86
  print("待分割的音频数: ", len(wav_path_list))
86
87
 
@@ -179,7 +180,7 @@ def audio_split_random(source_dir, target_dir, min_duration=3, max_duration=10,
179
180
  wav, wav_sr = sf.read(wav_path, always_2d=True)
180
181
  assert wav_sr == sr, f"音频采样率不匹配: {wav_sr} != {sr}"
181
182
  count = 0
182
- while len(wav) > min_duration * sr:
183
+ while len(wav) > max_duration * sr:
183
184
  segment_len = random.randint(min_duration * sr, max_duration * sr)
184
185
  segment = wav[0: segment_len]
185
186
  wav = wav[segment_len:]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neverlib
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A successful sign for python setup
5
5
  Author-email: "Never.Ling" <1786088386@qq.com>
6
6
  License: MIT
@@ -14,7 +14,7 @@ neverlib/filter/common.py,sha256=9MGVpnW2D6wYxO0-5Kru4SwmB7CriPZqf5FacTt6b7Y,103
14
14
  neverlib/tests/__init__.py,sha256=PITL4btOVji1rexFP35A20v2gcLqc6vmGWiF-_5ywnI,27
15
15
  neverlib/tests/test_preprocess.py,sha256=GHj2PvlG8chJlV-zpRfy8IYlTXzGkn5heO9ipy6Xe20,1003
16
16
  neverlib/utils/__init__.py,sha256=kUUhBstCxeXNg3WMmHyrNcx6aDNhUs_LucyygnOF4Ro,137
17
- neverlib/utils/audio_split.py,sha256=pRh2DqOg8Rg4o6QBv_xuQKWlZ4WI-RDqtCoP_-YTE6o,12014
17
+ neverlib/utils/audio_split.py,sha256=BdVcuqOUYCIwpio3lWdN_eLp_7ZMvW0g1PQ6A5hhd2s,12077
18
18
  neverlib/utils/checkGPU.py,sha256=Wye2UovtVK6Fk8W4wZ3dqaYrdZc30WyW5iGa-6Ouxf0,4075
19
19
  neverlib/utils/message.py,sha256=xeBwvHXJ0GTJ-4Mt0KrrfJNk3JY22_fxYwV7TTuLjWk,4235
20
20
  neverlib/utils/utils.py,sha256=A3zqRVIoZeskuDMI_Dnx7g46yyN8ZT1k1g0x0prK_6A,12336
@@ -33,8 +33,8 @@ neverlib/vad/class_get_speech.py,sha256=yIfGqvtsLCkDsOwS8HOGf9jZnt7WN5yMt_vgTAGr
33
33
  neverlib/vad/class_vad.py,sha256=u5szyOHjDrLt3-OA4TKlGZu8R8nQ6t1znatNlYhPwsI,5216
34
34
  neverlib/vad/utils.py,sha256=oHYIDnG_rCEJWbgvCBDQ2QQtuaKOPCcaF4AdwOZJkqI,1151
35
35
  neverlib/wav_data/000_short.wav,sha256=3pVeI6yGfjiD2q1_A9F_mIEYQnUhp9AMjy-gR4TAqK8,210430
36
- neverlib-0.2.1.dist-info/licenses/LICENSE,sha256=h-U7vhFdQhieyaNCiA_utrRNMk1rjfrBAUJVodgkfsw,1096
37
- neverlib-0.2.1.dist-info/METADATA,sha256=Wrs11TrjG0RYGGJ4JzThMmV3wz78qSbx3542vhPW-M4,2624
38
- neverlib-0.2.1.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
39
- neverlib-0.2.1.dist-info/top_level.txt,sha256=QqwYFuDiY_iFTz0Kx8av6zKCP_s4M5NiMTNsIXOy8Po,9
40
- neverlib-0.2.1.dist-info/RECORD,,
36
+ neverlib-0.2.2.dist-info/licenses/LICENSE,sha256=h-U7vhFdQhieyaNCiA_utrRNMk1rjfrBAUJVodgkfsw,1096
37
+ neverlib-0.2.2.dist-info/METADATA,sha256=u2XTAy3PS2ptBFTsqs_YlHXFOePloV2jHrcgNAsCIqs,2624
38
+ neverlib-0.2.2.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
39
+ neverlib-0.2.2.dist-info/top_level.txt,sha256=QqwYFuDiY_iFTz0Kx8av6zKCP_s4M5NiMTNsIXOy8Po,9
40
+ neverlib-0.2.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.1)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5