-
Notifications
You must be signed in to change notification settings - Fork 210
/
SogouTTS.java
34 lines (27 loc) · 898 Bytes
/
SogouTTS.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 SogouTTS extends AbstractTTS {
// 中、英文
private final static String url1 = "http://fanyi.sogou.com/reventondc/synthesis";
// 其他语种
private final static String url2 = "http://fanyi.sogou.com/reventondc/microsoftGetSpeakFile";
// 语速
private final static int speed = 1;
public SogouTTS() {
super(url1);
setLangSupport();
}
@Override
public void setLangSupport() {
langMap.put(LANG.ZH, "zh-CHS");
langMap.put(LANG.EN, "en");
}
@Override
public void setFormData(LANG source, String text) {
formData.put("text", text);
formData.put("speed", String.valueOf(speed));
formData.put("lang", langMap.get(source));
formData.put("from", "translateweb");
}
}