czyoung commited on
Commit
dbd0dd8
·
verified ·
1 Parent(s): e708b94

Update sonogram_utility.py

Browse files
Files changed (1) hide show
  1. sonogram_utility.py +2 -2
sonogram_utility.py CHANGED
@@ -129,8 +129,8 @@ def audioNormalize(waveform,sampleRate,stepSizeInSeconds = 2,dbThreshold = -50,d
129
  currEnd = int(min(currStart + stepSizeInSeconds * sampleRate, len(copyWaveform[0])-1))
130
  done = False
131
  while(not done):
132
- print(f"{currStart//len(copyWaveform[0]):.2f}% equalized")
133
  copyWaveform_db = waveform[:,currStart:currEnd].clone().detach()
 
134
  copyWaveform_db = transform(copyWaveform_db)
135
  if currStart == 0:
136
  print("First DB level calculated")
@@ -149,7 +149,7 @@ def audioNormalize(waveform,sampleRate,stepSizeInSeconds = 2,dbThreshold = -50,d
149
  if currStart > currEnd:
150
  done = True
151
  else:
152
- currEnd = int(min(currStart + stepSizeInSeconds * sampleRate, len(copyWaveform_db[0])-1))
153
  print("Waveform enhanced")
154
  return copyWaveform
155
 
 
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()
133
+ print(copyWaveform_db.shape)
134
  copyWaveform_db = transform(copyWaveform_db)
135
  if currStart == 0:
136
  print("First DB level calculated")
 
149
  if currStart > currEnd:
150
  done = True
151
  else:
152
+ currEnd = int(min(currStart + stepSizeInSeconds * sampleRate, len(copyWaveform[0])-1))
153
  print("Waveform enhanced")
154
  return copyWaveform
155