forked from ardha27/AICoverGen-Mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
no_ui.py
60 lines (55 loc) · 1.99 KB
/
no_ui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# @title Generate | Output generated inside "AICoverGen\song_output\random_number"
# @markdown Main Option | You also can input audio path inside "SONG_INPUT"
SONG_INPUT = input("Enter Youtube URL: ") # @param {type:"string"}
RVC_DIRNAME = "Daemi" # @param {type:"string"}
PITCH_CHANGE = 0 # @param {type:"integer"}
PITCH_CHANGE_ALL = 0 # @param {type:"integer"}
# @markdown Voice Conversion Options
INDEX_RATE = 0.2 # @param {type:"number"}
FILTER_RADIUS = 3 # @param {type:"integer"}
PITCH_DETECTION_ALGO = "rmvpe" # @param ["rmvpe", "mangio-crepe"]
CREPE_HOP_LENGTH = 128 # @param {type:"integer"}
PROTECT = 0.33 # @param {type:"number"}
REMIX_MIX_RATE = 0.25 # @param {type:"number"}
# @markdown Audio Mixing Options
MAIN_VOL = 0 # @param {type:"integer"}
BACKUP_VOL = 0 # @param {type:"integer"}
INST_VOL = 0 # @param {type:"integer"}
# @markdown Reverb Control
REVERB_SIZE = 0.15 # @param {type:"number"}
REVERB_WETNESS = 0.2 # @param {type:"number"}
REVERB_DRYNESS = 0.8 # @param {type:"number"}
REVERB_DAMPING = 0.7 # @param {type:"number"}
# @markdown Output Format
OUTPUT_FORMAT = "wav" # @param ["mp3", "wav"]
import subprocess
command = [
"python",
"src/main.py",
"-i", SONG_INPUT,
"-dir", RVC_DIRNAME,
"-p", str(PITCH_CHANGE),
"-k",
"-ir", str(INDEX_RATE),
"-fr", str(FILTER_RADIUS),
"-rms", str(REMIX_MIX_RATE),
"-palgo", PITCH_DETECTION_ALGO,
"-hop", str(CREPE_HOP_LENGTH),
"-pro", str(PROTECT),
"-mv", str(MAIN_VOL),
"-bv", str(BACKUP_VOL),
"-iv", str(INST_VOL),
"-pall", str(PITCH_CHANGE_ALL),
"-rsize", str(REVERB_SIZE),
"-rwet", str(REVERB_WETNESS),
"-rdry", str(REVERB_DRYNESS),
"-rdamp", str(REVERB_DAMPING),
"-oformat", OUTPUT_FORMAT
]
# Open a subprocess and capture its output
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
# Print the output in real-time
for line in process.stdout:
print(line, end='')
# Wait for the process to finish
process.wait()