Customize rainbow fart voice package using iFLYTEK TTS
rainbow-fart-tts
After the rainbow fart plug-in is red, do you want to generate a defined voice package? This paper gives a solution to generate rainbow fart voice package using iFLYTEK's TTS. You can completely customize the text and pronunciation people!
Open source address: https://github.com/jadepeng/rainbow-fart-tts
Modify text
Open manifest JSON, modify text, and add keyword and corresponding text as needed
{
"keywords": [
"if","else"
],"text": [
"你就是因为想太多如果,所以才交不到女朋友吧?"," 别试了,我的可爱不需要用 if 来判断!"," 人生没有那么多如果,有没有比编程更容易呢?"
]
}
Get developer account
reach https://www.xfyun.cn/ Register an account, create an application, and then open voice synthesis. You can open a free package, so that you can buy a package.
Then go to the control panel to view appid and other information:
Then open voicepackagemakerapp and fill in the corresponding information:
public class VoicePackageMakerApp {
private static final String hostUrl = "https://tts-api.xfyun.cn/v2/tts";
// 到控制台-语音合成页面获取
private static final String APPID = "";
// 到控制台-语音合成页面获取
private static final String API_SECRET = "";
//到控制台-语音合成页面获取
private static final String API_KEY = "";
Select speaker
IFLYTEK's open platform for online speech synthesis has many speakers who can https://www.xfyun.cn/services/online_tts see:
Select your favorite, and then go to the control panel to open permissions:
For example, I choose sister xunfeiling (sister Zhilin), whose pronunciation is x_xiaoling. Modify the code:
public class VoicePackageMakerApp {
// 默认发音人
private static final String DEFAULT_VCN = "x_xiaoling";
Generating and using voice packets
After the above steps are completed, just run voicepackagemaker app directly, and then x will be generated in the voicepackages directory_ Xiaoling folder, which is a synthetic voice package, can be used by various versions of rainbow fart plug-ins.
Open source address of this article: https://github.com/jadepeng/rainbow-fart-tts
For the IDE version of the voice pack, see: https://github.com/jadepeng/idea-rainbow-fart