yuchen005 commited on
Commit
d6d7afb
1 Parent(s): 527fc0c

Update add_speech_feats_to_train_data.py

Browse files
Files changed (1) hide show
  1. add_speech_feats_to_train_data.py +2 -2
add_speech_feats_to_train_data.py CHANGED
@@ -25,13 +25,13 @@ for item in data:
25
 
26
  ### extract clean audio feats
27
  clean_audio = whisper.load_audio(clean_audio_path)
28
- clean_audio = whisper.pad_or_trim(clean_audio)
29
  clean_mel = whisper.log_mel_spectrogram(clean_audio).to(model.device)
30
  clean_audio_features = model.encoder(clean_mel.unsqueeze(0))[0]
31
 
32
  # noisy audio feats
33
  noisy_audio = whisper.load_audio(noisy_audio_path)
34
- noisy_audio = whisper.pad_or_trim(noisy_audio)
35
  noisy_mel = whisper.log_mel_spectrogram(noisy_audio).to(model.device)
36
  noisy_audio_features = model.encoder(noisy_mel.unsqueeze(0))[0]
37
 
 
25
 
26
  ### extract clean audio feats
27
  clean_audio = whisper.load_audio(clean_audio_path)
28
+ # clean_audio = whisper.pad_or_trim(clean_audio) # padding to 30s
29
  clean_mel = whisper.log_mel_spectrogram(clean_audio).to(model.device)
30
  clean_audio_features = model.encoder(clean_mel.unsqueeze(0))[0]
31
 
32
  # noisy audio feats
33
  noisy_audio = whisper.load_audio(noisy_audio_path)
34
+ # noisy_audio = whisper.pad_or_trim(noisy_audio) # padding to 30s
35
  noisy_mel = whisper.log_mel_spectrogram(noisy_audio).to(model.device)
36
  noisy_audio_features = model.encoder(noisy_mel.unsqueeze(0))[0]
37