Spaces:
Sleeping
Sleeping
Update sonogram_utility.py
Browse files- sonogram_utility.py +1 -1
sonogram_utility.py
CHANGED
|
@@ -126,7 +126,7 @@ def audioNormalize(waveform,sampleRate,stepSizeInSeconds = 2,dbThreshold = -50,d
|
|
| 126 |
print("Waveform copy made")
|
| 127 |
transform = torchaudio.transforms.AmplitudeToDB(stype="amplitude", top_db=80)
|
| 128 |
currStart = 0
|
| 129 |
-
currEnd = int(min(currStart + stepSizeInSeconds * sampleRate, len(
|
| 130 |
done = False
|
| 131 |
while(not done):
|
| 132 |
copyWaveform_db = waveform[:,currStart:currEnd].clone().detach()
|
|
|
|
| 126 |
print("Waveform copy made")
|
| 127 |
transform = torchaudio.transforms.AmplitudeToDB(stype="amplitude", top_db=80)
|
| 128 |
currStart = 0
|
| 129 |
+
currEnd = int(min(currStart + stepSizeInSeconds * sampleRate, len(copyWaveform[0])-1))
|
| 130 |
done = False
|
| 131 |
while(not done):
|
| 132 |
copyWaveform_db = waveform[:,currStart:currEnd].clone().detach()
|