Spaces:
Runtime error
Runtime error
remove fnax parameter
Browse files- audiodiffusion/mel.py +2 -4
audiodiffusion/mel.py
CHANGED
@@ -16,7 +16,7 @@ class Mel:
|
|
16 |
sample_rate: int = 22050,
|
17 |
n_fft: int = 2048,
|
18 |
hop_length: int = 512,
|
19 |
-
top_db: int = 80
|
20 |
):
|
21 |
"""Class to convert audio to mel spectrograms and vice versa.
|
22 |
|
@@ -35,7 +35,6 @@ class Mel:
|
|
35 |
self.hop_length = hop_length
|
36 |
self.n_mels = self.y_res
|
37 |
self.slice_size = self.x_res * self.hop_length - 1
|
38 |
-
self.fmax = self.sr / 2
|
39 |
self.top_db = top_db
|
40 |
self.audio = None
|
41 |
|
@@ -100,8 +99,7 @@ class Mel:
|
|
100 |
sr=self.sr,
|
101 |
n_fft=self.n_fft,
|
102 |
hop_length=self.hop_length,
|
103 |
-
n_mels=self.n_mels
|
104 |
-
fmax=self.fmax,
|
105 |
)
|
106 |
log_S = librosa.power_to_db(S, ref=np.max, top_db=self.top_db)
|
107 |
bytedata = (((log_S + self.top_db) * 255 / self.top_db).clip(0, 255) +
|
|
|
16 |
sample_rate: int = 22050,
|
17 |
n_fft: int = 2048,
|
18 |
hop_length: int = 512,
|
19 |
+
top_db: int = 80
|
20 |
):
|
21 |
"""Class to convert audio to mel spectrograms and vice versa.
|
22 |
|
|
|
35 |
self.hop_length = hop_length
|
36 |
self.n_mels = self.y_res
|
37 |
self.slice_size = self.x_res * self.hop_length - 1
|
|
|
38 |
self.top_db = top_db
|
39 |
self.audio = None
|
40 |
|
|
|
99 |
sr=self.sr,
|
100 |
n_fft=self.n_fft,
|
101 |
hop_length=self.hop_length,
|
102 |
+
n_mels=self.n_mels
|
|
|
103 |
)
|
104 |
log_S = librosa.power_to_db(S, ref=np.max, top_db=self.top_db)
|
105 |
bytedata = (((log_S + self.top_db) * 255 / self.top_db).clip(0, 255) +
|