Commit 7212f245 authored by thirdformant's avatar thirdformant Committed by Soumith Chintala
Browse files

Bug fix: if top_db is None then checking `top_db < 0` fails (#85)

parent 11486f78
......@@ -293,7 +293,7 @@ class SpectrogramToDB(object):
"""
def __init__(self, stype="power", top_db=None):
self.stype = stype
if top_db < 0:
if top_db is not None and top_db < 0:
raise ValueError('top_db must be positive value')
self.top_db = top_db
self.multiplier = 10. if stype == "power" else 20.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment