mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-04-06 03:57:44 +08:00
commit
38d0e91bc1
@ -25,7 +25,9 @@ model = AutoModel(model=path_asr, model_revision="v2.0.4",
|
|||||||
|
|
||||||
|
|
||||||
opt=[]
|
opt=[]
|
||||||
for name in os.listdir(dir):
|
file_names = os.listdir(dir)
|
||||||
|
file_names.sort()
|
||||||
|
for name in file_names:
|
||||||
try:
|
try:
|
||||||
text = model.generate(input="%s/%s"%(dir,name))[0]["text"]
|
text = model.generate(input="%s/%s"%(dir,name))[0]["text"]
|
||||||
opt.append("%s/%s|%s|ZH|%s"%(dir,name,opt_name,text))
|
opt.append("%s/%s|%s|ZH|%s"%(dir,name,opt_name,text))
|
||||||
|
@ -35,7 +35,7 @@ def slice(inp,opt_root,threshold,min_length,min_interval,hop_size,max_sil_kept,_
|
|||||||
if(tmp_max>1):chunk/=tmp_max
|
if(tmp_max>1):chunk/=tmp_max
|
||||||
chunk = (chunk / tmp_max * (_max * alpha)) + (1 - alpha) * chunk
|
chunk = (chunk / tmp_max * (_max * alpha)) + (1 - alpha) * chunk
|
||||||
wavfile.write(
|
wavfile.write(
|
||||||
"%s/%s_%s_%s.wav" % (opt_root, name, start, end),
|
"%s/%s_%010d_%010d.wav" % (opt_root, name, start, end),
|
||||||
32000,
|
32000,
|
||||||
# chunk.astype(np.float32),
|
# chunk.astype(np.float32),
|
||||||
(chunk * 32767).astype(np.int16),
|
(chunk * 32767).astype(np.int16),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user