ahassoun commited on
Commit
ce3ffca
1 Parent(s): 3388882

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -2
app.py CHANGED
@@ -1,14 +1,34 @@
1
- import json
2
  import gradio as gr
3
  from gradio import Dropdown
 
4
  import os
5
  import shutil
6
  import re
7
  user_choice = ""
8
-
 
9
  tts = TTS("tts_models/multilingual/multi-dataset/bark", gpu=True)
10
 
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  def infer(prompt, input_wav_file, clean_audio, hidden_numpy_audio):
14
  print("""
@@ -127,6 +147,17 @@ span.record-icon > span.dot.svelte-1thnwz {
127
  transform: rotate(360deg);
128
  }
129
  }
 
 
 
 
 
 
 
 
 
 
 
130
  """
131
 
132
 
 
1
+ from TTS.api import TTS
2
  import gradio as gr
3
  from gradio import Dropdown
4
+ from scipy.io.wavfile import write
5
  import os
6
  import shutil
7
  import re
8
  user_choice = ""
9
+ MAX_NUMBER_SENTENCES = 10
10
+ file_upload_available = os.environ.get("ALLOW_FILE_UPLOAD")
11
  tts = TTS("tts_models/multilingual/multi-dataset/bark", gpu=True)
12
 
13
 
14
+ def split_process(audio, chosen_out_track):
15
+ gr.Info("Cleaning your audio sample...")
16
+ os.makedirs("out", exist_ok=True)
17
+ write('test.wav', audio[0], audio[1])
18
+ os.system("python3 -m demucs.separate -n mdx_extra_q -j 4 test.wav -o out")
19
+ # return "./out/mdx_extra_q/test/vocals.wav","./out/mdx_extra_q/test/bass.wav","./out/mdx_extra_q/test/drums.wav","./out/mdx_extra_q/test/other.wav"
20
+ if chosen_out_track == "vocals":
21
+ print("Audio sample cleaned")
22
+ return "./out/mdx_extra_q/test/vocals.wav"
23
+ elif chosen_out_track == "bass":
24
+ return "./out/mdx_extra_q/test/bass.wav"
25
+ elif chosen_out_track == "drums":
26
+ return "./out/mdx_extra_q/test/drums.wav"
27
+ elif chosen_out_track == "other":
28
+ return "./out/mdx_extra_q/test/other.wav"
29
+ elif chosen_out_track == "all-in":
30
+ return "test.wav"
31
+
32
 
33
  def infer(prompt, input_wav_file, clean_audio, hidden_numpy_audio):
34
  print("""
 
147
  transform: rotate(360deg);
148
  }
149
  }
150
+ #share-btn-container {
151
+ display: flex;
152
+ padding-left: 0.5rem !important;
153
+ padding-right: 0.5rem !important;
154
+ background-color: #000000;
155
+ justify-content: center;
156
+ align-items: center;
157
+ border-radius: 9999px !important;
158
+ max-width: 15rem;
159
+ height: 36px;
160
+ }
161
  """
162
 
163