1.该功能基于度娘语音合成接口
2.下面代码直接粘贴到开发工具即可使用
3.APP_ID,API_KEY,SECRET_KEY这些需要你自己去度娘开发者中心申请。
public class SpeechSynthesis {
// 设置APPID/AK/SKpublic static final String APP_ID = "xxxx";// "你的 App ID"
public static final String API_KEY = "xxxxxx";// "你的 Api ID"
public static final String SECRET_KEY = "xxxxxx";// "你的 Secret Key"
public static void main(String[] args) {
AipSpeech client = initCilent();
HashMap<String, Object> options = initOptions();
StringBuffer text = new StringBuffer();
text.append(嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻嘻");
String textStr = text.toString();
int textLength = textStr.length();
int makeCount = textLength % 500 == 0 ? textLength / 500 : textL