-
Notifications
You must be signed in to change notification settings - Fork 210
/
BaiduTTS.java
34 lines (29 loc) · 930 Bytes
/
BaiduTTS.java
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
package com.swjtu.tts.impl;
import com.swjtu.lang.LANG;
import com.swjtu.tts.AbstractTTS;
public final class BaiduTTS extends AbstractTTS {
private final static String url = "http://fanyi.baidu.com/gettts";
private final static int spd = 3;
public BaiduTTS() {
super(url);
setLangSupport();
}
@Override
public void setLangSupport() {
langMap.put(LANG.ZH, "zh");
langMap.put(LANG.EN, "en");
langMap.put(LANG.JP, "jp");
langMap.put(LANG.KOR, "kor");
langMap.put(LANG.FRA, "fra");
langMap.put(LANG.RU, "ru");
langMap.put(LANG.DE, "de");
langMap.put(LANG.TH, "th");
}
@Override
public void setFormData(LANG source, String text) {
formData.put("lan", langMap.get(source));
formData.put("text", text);
formData.put("spd", String.valueOf(spd));
formData.put("source", "web");
}
}