kevinwang676 commited on
Commit
9f4df50
1 Parent(s): f0bb553

Update app_multi.py

Browse files
Files changed (1) hide show
  1. app_multi.py +14 -121
app_multi.py CHANGED
@@ -660,18 +660,18 @@ with app:
660
  with gr.Row():
661
  with gr.Column():
662
  input_audio = as_audio_vocals
663
- vc_convert_btn1 = gr.Button('进行歌声转换吧!', variant='primary')
664
  full_song = gr.Button("加入歌曲伴奏吧!", variant="primary")
665
  new_song = gr.Audio(label="AI歌手+伴奏", type="filepath")
666
 
667
- pitch_adjust1 = gr.Slider(
668
  label='Pitch',
669
  minimum=-24,
670
  maximum=24,
671
  step=1,
672
  value=0
673
  )
674
- f0_method1 = gr.Radio(
675
  label='f0 methods',
676
  choices=['pm', 'rmvpe'],
677
  value='pm',
@@ -679,7 +679,7 @@ with app:
679
  )
680
 
681
  with gr.Accordion('更多设置', open=False):
682
- feat_ratio1 = gr.Slider(
683
  label='Feature ratio',
684
  minimum=0,
685
  maximum=1,
@@ -687,7 +687,7 @@ with app:
687
  value=0.6,
688
  visible=False
689
  )
690
- filter_radius1 = gr.Slider(
691
  label='Filter radius',
692
  minimum=0,
693
  maximum=7,
@@ -695,7 +695,7 @@ with app:
695
  value=3,
696
  visible=False
697
  )
698
- rms_mix_rate1 = gr.Slider(
699
  label='Volume envelope mix rate',
700
  minimum=0,
701
  maximum=1,
@@ -703,7 +703,7 @@ with app:
703
  value=1,
704
  visible=False
705
  )
706
- resample_rate1 = gr.Dropdown(
707
  [
708
  'Disable resampling',
709
  '16000',
@@ -737,16 +737,16 @@ with app:
737
  elem_id='model_info'
738
  )
739
 
740
- output_audio1 = gr.Audio(label='AI歌手(无伴奏)', type="filepath")
741
- output_msg1 = gr.Textbox(label='Output message')
742
 
743
- vc_convert_btn1.click(
744
  vc_func,
745
  [
746
- input_audio, model_index, pitch_adjust1, f0_method1, feat_ratio1,
747
- filter_radius1, rms_mix_rate1, resample_rate1
748
  ],
749
- [output_audio1, output_msg1],
750
  api_name='audio_conversion'
751
  )
752
 
@@ -758,114 +758,7 @@ with app:
758
  outputs=[model_info],
759
  show_progress=False,
760
  queue=False
761
- )
762
-
763
-
764
- with gr.Tab('🎙️ - 文本转语音'):
765
- with gr.Row():
766
- with gr.Column():
767
- tts_input = gr.Textbox(
768
- label='请填写您想要转换的文本(中英皆可)',
769
- lines=3
770
- )
771
- tts_speaker = gr.Dropdown(
772
- [
773
- '%s (%s)' % (
774
- s['FriendlyName'],
775
- s['Gender']
776
- )
777
- for s in tts_speakers_list
778
- ],
779
- label='请选择一个相应语言的说话人',
780
- type='index'
781
- )
782
-
783
- tts_convert_btn = gr.Button('进行AI变声吧', variant='primary')
784
- pitch_adjust2 = gr.Slider(
785
- label='Pitch',
786
- minimum=-24,
787
- maximum=24,
788
- step=1,
789
- value=0
790
- )
791
- f0_method2 = gr.Radio(
792
- label='f0 methods',
793
- choices=['pm', 'rmvpe'],
794
- value='pm',
795
- interactive=True
796
- )
797
-
798
- with gr.Accordion('更多设置', open=False):
799
- feat_ratio2 = gr.Slider(
800
- label='Feature ratio',
801
- minimum=0,
802
- maximum=1,
803
- step=0.1,
804
- value=0.6,
805
- visible=False
806
- )
807
- filter_radius2 = gr.Slider(
808
- label='Filter radius',
809
- minimum=0,
810
- maximum=7,
811
- step=1,
812
- value=3,
813
- visible=False
814
- )
815
- rms_mix_rate2 = gr.Slider(
816
- label='Volume envelope mix rate',
817
- minimum=0,
818
- maximum=1,
819
- step=0.1,
820
- value=1,
821
- visible=False
822
- )
823
- resample_rate2 = gr.Dropdown(
824
- [
825
- 'Disable resampling',
826
- '16000',
827
- '22050',
828
- '44100',
829
- '48000'
830
- ],
831
- label='Resample rate',
832
- value='Disable resampling'
833
- )
834
-
835
- with gr.Column():
836
- # Model select
837
- model_index2 = gr.Dropdown(
838
- [
839
- '%s - %s' % (
840
- m['metadata'].get('source', 'Unknown'),
841
- m['metadata'].get('name')
842
- )
843
- for m in loaded_models
844
- ],
845
- label='请选择您的AI歌手(必选)',
846
- type='index'
847
- )
848
-
849
- # Model info
850
- with gr.Box():
851
- model_info = gr.Markdown(
852
- '### AI歌手信息\n'
853
- 'Please select a model from dropdown above.',
854
- elem_id='model_info'
855
- )
856
-
857
- output_audio2 = gr.Audio(label='AI歌手(无伴奏)', type="filepath")
858
- output_msg2 = gr.Textbox(label='Output message')
859
-
860
- tts_convert_btn.click(
861
- edge_tts_vc_func,
862
- [
863
- tts_input, model_index2, tts_speaker, pitch_adjust2, f0_method2,
864
- feat_ratio2, filter_radius2, rms_mix_rate2, resample_rate2
865
- ],
866
- [output_audio2, output_msg2],
867
- api_name='tts_conversion'
868
- )
869
 
870
  with gr.Tab("📺 - 音乐视频"):
871
  with gr.Row():
 
660
  with gr.Row():
661
  with gr.Column():
662
  input_audio = as_audio_vocals
663
+ vc_convert_btn = gr.Button('进行歌声转换吧!', variant='primary')
664
  full_song = gr.Button("加入歌曲伴奏吧!", variant="primary")
665
  new_song = gr.Audio(label="AI歌手+伴奏", type="filepath")
666
 
667
+ pitch_adjust = gr.Slider(
668
  label='Pitch',
669
  minimum=-24,
670
  maximum=24,
671
  step=1,
672
  value=0
673
  )
674
+ f0_method = gr.Radio(
675
  label='f0 methods',
676
  choices=['pm', 'rmvpe'],
677
  value='pm',
 
679
  )
680
 
681
  with gr.Accordion('更多设置', open=False):
682
+ feat_ratio = gr.Slider(
683
  label='Feature ratio',
684
  minimum=0,
685
  maximum=1,
 
687
  value=0.6,
688
  visible=False
689
  )
690
+ filter_radius = gr.Slider(
691
  label='Filter radius',
692
  minimum=0,
693
  maximum=7,
 
695
  value=3,
696
  visible=False
697
  )
698
+ rms_mix_rate = gr.Slider(
699
  label='Volume envelope mix rate',
700
  minimum=0,
701
  maximum=1,
 
703
  value=1,
704
  visible=False
705
  )
706
+ resample_rate = gr.Dropdown(
707
  [
708
  'Disable resampling',
709
  '16000',
 
737
  elem_id='model_info'
738
  )
739
 
740
+ output_audio = gr.Audio(label='AI歌手(无伴奏)', type="filepath")
741
+ output_msg = gr.Textbox(label='Output message')
742
 
743
+ vc_convert_btn.click(
744
  vc_func,
745
  [
746
+ input_audio, model_index, pitch_adjust, f0_method, feat_ratio,
747
+ filter_radius, rms_mix_rate, resample_rate
748
  ],
749
+ [output_audio, output_msg],
750
  api_name='audio_conversion'
751
  )
752
 
 
758
  outputs=[model_info],
759
  show_progress=False,
760
  queue=False
761
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
 
763
  with gr.Tab("📺 - 音乐视频"):
764
  with gr.Row():