Skip to content
Snippets Groups Projects
Unverified Commit ff141ef6 authored by Peter Plantinga's avatar Peter Plantinga Committed by GitHub
Browse files

Fix saving bug #1164 when enhancing files (#2384)

parent ee144449
No related branches found
No related tags found
No related merge requests found
......@@ -105,7 +105,11 @@ class SpectralMaskEnhancement(Pretrained):
enhanced = self.enhance_batch(batch)
if output_filename is not None:
torchaudio.save(output_filename, enhanced, channels_first=False)
torchaudio.save(
uri=output_filename,
src=enhanced,
sample_rate=self.hparams.compute_stft.sample_rate,
)
return enhanced.squeeze(0)
......@@ -169,7 +173,11 @@ class WaveformEnhancement(Pretrained):
enhanced = self.enhance_batch(batch)
if output_filename is not None:
torchaudio.save(output_filename, enhanced, channels_first=False)
torchaudio.save(
uri=output_filename,
src=enhanced,
sample_rate=self.audio_normalizer.sample_rate,
)
return enhanced.squeeze(0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment