-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
48 lines (43 loc) · 1.43 KB
/
main.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
import os
import sys
from urllib import request
from wavsave import *
from wavresample import *
from utils import *
from curl import *
from voice import *
def usage():
print("The HMM/DNN-Based Singing Voice Syntheis System \"SinsyPlus\"")
print("Version 0.0.1 (https://github.com/740291272/SinsyPlus)")
print("Copyright (C)2009-2018 Nagoya Institute of Technology")
print("Copyright (C)2017-2018 GloomyGhost")
print("All rights reserved")
print()
print("Usage:")
print("\tSinsyPlus [infile] [Language]")
print("\t\tLanguage:")
print("\t\t\tJapanese:ja")
print("\t\t\tChinese :ch")
print("\t\t\tEnglish :en")
print("\tExample : sinsyplus voice.xml ja ")
os.system('pause')
# 程序入口
if __name__ == '__main__':
if len(sys.argv) < 2:
usage()
else:
XML = sys.argv[1] # 读取XML
if len(sys.argv) < 3:
lang = lang() # 读取语言
else:
lang = langnum(sys.argv[2])
langstr = langstr(lang) # 获取语言
print(langstr)
print("Upload MusicXML...")
fileName = text(curl(lang, langstr, XML)) # 获取文件名
print("Synthesising from servers...")
req = request.Request('http://sinsy.sp.nitech.ac.jp/temp/'+ fileName + ".wav")
link = "http://sinsy.sp.nitech.ac.jp/temp/"+ fileName + ".wav"
# Save Wav
fileNameSave = fileName + ".wav"
download(link, fileNameSave)