diff --git a/dac/model/dac.py b/dac/model/dac.py index eb754b2..5d2084e 100644 --- a/dac/model/dac.py +++ b/dac/model/dac.py @@ -102,6 +102,7 @@ def __init__(self, input_dim: int = 16, output_dim: int = 8, stride: int = 1): kernel_size=2 * stride, stride=stride, padding=math.ceil(stride / 2), + output_padding=0 if stride % 2 == 0 else 1 ), ResidualUnit(output_dim, dilation=1), ResidualUnit(output_dim, dilation=3), @@ -195,10 +196,9 @@ def __init__( self.delay = self.get_delay() - def preprocess(self, audio_data, sample_rate): - if sample_rate is None: - sample_rate = self.sample_rate - assert sample_rate == self.sample_rate + def preprocess(self, audio_data, sample_rate=None): + if sample_rate: + assert sample_rate == self.sample_rate, f'Expected sample rate is {self.sample_rate}' length = audio_data.shape[-1] right_pad = math.ceil(length / self.hop_length) * self.hop_length - length diff --git a/setup.py b/setup.py index b681d97..9b4fa0f 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="descript-audio-codec", - version="1.0.0", + version="1.0.1", classifiers=[ "Intended Audience :: Developers", "Natural Language :: English",