pplantinga commited on
Commit
5738ab4
1 Parent(s): d74275f

Fix example by switching to "enhance_batch" (#3)

Browse files

- Fix example by switching to "enhance_batch" (9c8d29ed708148065d2ecb2d6a063274c60a2759)

Files changed (1) hide show
  1. README.md +5 -2
README.md CHANGED
@@ -67,10 +67,13 @@ enhance_model = SpectralMaskEnhancement.from_hparams(
67
  source="speechbrain/mtl-mimic-voicebank",
68
  savedir="pretrained_models/mtl-mimic-voicebank",
69
  )
70
- enhanced = enhance_model.enhance_file("speechbrain/mtl-mimic-voicebank/example.wav")
 
 
 
71
 
72
  # Saving enhanced signal on disk
73
- torchaudio.save('enhanced.wav', enhanced.unsqueeze(0).cpu(), 16000)
74
  ```
75
 
76
  The system is trained with recordings sampled at 16kHz (single channel).
 
67
  source="speechbrain/mtl-mimic-voicebank",
68
  savedir="pretrained_models/mtl-mimic-voicebank",
69
  )
70
+ noisy = enhance_model.load_audio("speechbrain/mtl-mimic-voicebank/example.wav")
71
+
72
+ # Add batch dimension and enhance
73
+ enhanced = enhance_model.enhance_batch(noisy.unsqueeze(0))
74
 
75
  # Saving enhanced signal on disk
76
+ torchaudio.save('enhanced.wav', enhanced.cpu(), 16000)
77
  ```
78
 
79
  The system is trained with recordings sampled at 16kHz (single channel).