We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f63571 commit 5428cc6Copy full SHA for 5428cc6
utils/utils.py
@@ -13,7 +13,7 @@ def read_wav_np(wavpath):
13
file_format = wavpath.split('.')[-1]
14
audio = AudioSegment.from_file(wavpath, file_format)
15
data = audio.raw_data
16
- wav = np.frombuffer(data, dtype=np.uint8)
+ wav = np.frombuffer(data, dtype=np.uint16)
17
18
if len(wav.shape) == 2:
19
wav = wav[:, 0]
@@ -37,6 +37,6 @@ def cut_wav(L, wav):
37
'constant', constant_values=0.0)
38
else:
39
start = random.randint(0, samples - L)
40
- wav = wav[start:start+L]
+ wav = wav[start:start + L]
41
42
return wav
0 commit comments