mthsk commited on
Commit
7aa290d
·
1 Parent(s): 72445d6

Increase max audio length from 20 seconds to 60

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -48,8 +48,8 @@ def create_vc_fn(model, sid):
48
  return "You need to upload an audio", None
49
  sampling_rate, audio = input_audio
50
  duration = audio.shape[0] / sampling_rate
51
- if duration > 20 and limitation:
52
- return "Please upload an audio file that is less than 20 seconds. If you need to generate a longer audio file, please use Colab.", None
53
  audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
54
  if len(audio.shape) > 1:
55
  audio = librosa.to_mono(audio.transpose(1, 0))
@@ -110,7 +110,7 @@ if __name__ == '__main__':
110
  )
111
  with gr.Row():
112
  with gr.Column():
113
- vc_input = gr.Audio(label="Input audio"+' (less than 20 seconds)' if limitation else '')
114
  vc_transform = gr.Number(label="vc_transform", value=0)
115
  auto_f0 = gr.Checkbox(label="auto_f0", value=False)
116
  tts_mode = gr.Checkbox(label="tts (use edge-tts as input)", value=False)
 
48
  return "You need to upload an audio", None
49
  sampling_rate, audio = input_audio
50
  duration = audio.shape[0] / sampling_rate
51
+ if duration > 60 and limitation:
52
+ return "Please upload an audio file that is less than 60 seconds. If you need to generate a longer audio file, please use Colab.", None
53
  audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
54
  if len(audio.shape) > 1:
55
  audio = librosa.to_mono(audio.transpose(1, 0))
 
110
  )
111
  with gr.Row():
112
  with gr.Column():
113
+ vc_input = gr.Audio(label="Input audio"+' (less than 60 seconds)' if limitation else '')
114
  vc_transform = gr.Number(label="vc_transform", value=0)
115
  auto_f0 = gr.Checkbox(label="auto_f0", value=False)
116
  tts_mode = gr.Checkbox(label="tts (use edge-tts as input)", value=False)