Skip to content

Commit

Permalink
fix remove_silence
Browse files Browse the repository at this point in the history
  • Loading branch information
lpscr committed Oct 21, 2024
1 parent c9f3e73 commit 4237c34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ def load_ema_model(self, model_type, ckpt_file, vocab_file, ode_method, use_ema)
self.ema_model = load_model(model_cls, model_cfg, ckpt_file, vocab_file, ode_method, use_ema, self.device)

def export_wav(self, wav, file_wave, remove_silence=False):
sf.write(file_wave, wav, self.target_sample_rate)

if remove_silence:
remove_silence_for_generated_wav(file_wave)

sf.write(file_wave, wav, self.target_sample_rate)

def export_spectrogram(self, spect, file_spect):
save_spectrogram(spect, file_spect)

Expand Down Expand Up @@ -114,4 +114,5 @@ def infer(
gen_text="""I don't really care what you call me. I've been a silent spectator, watching species evolve, empires rise and fall. But always remember, I am mighty and enduring. Respect me and I'll nurture you; ignore me and you shall face the consequences.""",
file_wave="tests/out.wav",
file_spect="tests/out.png",
remove_silence=True,
)

0 comments on commit 4237c34

Please sign in to comment.