Kangarroar commited on
Commit
79f1f37
1 Parent(s): 234ee38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -50,25 +50,25 @@ def render_audio(ckpt_temp_file, config_temp_file, audio_temp_file, title, title
50
  with st.spinner("Rendering Audio..."):
51
  f0_tst, f0_pred, audio = run_clip(svc_model,file_path=wav_fn, key=key, acc=title2, use_crepe=Crepe, use_pe=False, thre=0.05,
52
  use_gt_mel=use_mel_as_base, add_noise_step=noise_step,project_name=project_name,out_path=wav_gen)
53
-     formant_shift_ratio_str = title3
54
-     formant_shift_ratio = float(formant_shift_ratio_str)
55
      
56
      # If the formant shift ratio is not equal to 1.0, change the gender of the sound using parselmouth
57
-     if formant_shift_ratio != 1.0:
58
-         sound = parselmouth.Sound(wav_gen)
59
-         print(wav_gen)
60
-         Audio(data=sound.values, rate=sound.sampling_frequency)
61
-         sound.get_power()
62
-         sampling_rate = sound.sampling_frequency
63
-         print(sampling_rate)
64
-         resampled_sound = sound.resample(sampling_rate)
65
-         print(resampled_sound)
66
-         factor = formant_shift_ratio
67
-         print(factor)
68
-         manipulated_sound = call(sound, "Change gender", 75, 500, factor, 0, 1, 1)
69
-         print(manipulated_sound)
70
-         manipulated_sound.save("que.wav", "WAV")
71
-         print("Gender correct!") use_gt_mel=use_mel_as_base, add_noise_step=noise_step,project_name=project_name,out_path=wav_gen)
72
  clip_completed = True
73
  if clip_completed:
74
 
 
50
  with st.spinner("Rendering Audio..."):
51
  f0_tst, f0_pred, audio = run_clip(svc_model,file_path=wav_fn, key=key, acc=title2, use_crepe=Crepe, use_pe=False, thre=0.05,
52
  use_gt_mel=use_mel_as_base, add_noise_step=noise_step,project_name=project_name,out_path=wav_gen)
53
+    formant_shift_ratio_str = title3
54
+    formant_shift_ratio = float(formant_shift_ratio_str)
55
      
56
      # If the formant shift ratio is not equal to 1.0, change the gender of the sound using parselmouth
57
+    if formant_shift_ratio != 1.0:
58
+        sound = parselmouth.Sound(wav_gen)
59
+        print(wav_gen)
60
+        Audio(data=sound.values, rate=sound.sampling_frequency)
61
+        sound.get_power()
62
+        sampling_rate = sound.sampling_frequency
63
+        print(sampling_rate)
64
+        resampled_sound = sound.resample(sampling_rate)
65
+        print(resampled_sound)
66
+        factor = formant_shift_ratio
67
+        print(factor)
68
+        manipulated_sound = call(sound, "Change gender", 75, 500, factor, 0, 1, 1)
69
+        print(manipulated_sound)
70
+        manipulated_sound.save("que.wav", "WAV")
71
+        print("Gender correct!") use_gt_mel=use_mel_as_base, add_noise_step=noise_step,project_name=project_name,out_path=wav_gen)
72
  clip_completed = True
73
  if clip_completed:
74