Commit ca041e96 by 苗权威

10.30

parent 7f085a36
<component name="libraryTable">
<library name="Maven: com.google.code.gson:gson:2.8.6">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/google/code/gson/gson/2.8.6/gson-2.8.6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/google/code/gson/gson/2.8.6/gson-2.8.6-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.squareup.okhttp:logging-interceptor:2.7.5">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/squareup/okhttp/logging-interceptor/2.7.5/logging-interceptor-2.7.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/squareup/okhttp/logging-interceptor/2.7.5/logging-interceptor-2.7.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/squareup/okhttp/logging-interceptor/2.7.5/logging-interceptor-2.7.5-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.squareup.okhttp:okhttp:2.5.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/squareup/okhttp/okhttp/2.5.0/okhttp-2.5.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/squareup/okhttp/okhttp/2.5.0/okhttp-2.5.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/squareup/okhttp/okhttp/2.5.0/okhttp-2.5.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.tencentcloudapi:tencentcloud-sdk-java:3.1.156">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/tencentcloudapi/tencentcloud-sdk-java/3.1.156/tencentcloud-sdk-java-3.1.156.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/tencentcloudapi/tencentcloud-sdk-java/3.1.156/tencentcloud-sdk-java-3.1.156-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/tencentcloudapi/tencentcloud-sdk-java/3.1.156/tencentcloud-sdk-java-3.1.156-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: commons-logging:commons-logging:1.2">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/commons-logging/commons-logging/1.2/commons-logging-1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../../../maven/myRepository/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
......@@ -59,6 +59,7 @@
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
......@@ -92,6 +93,13 @@
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.tencentcloudapi/tencentcloud-sdk-java -->
<dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java</artifactId>
<version>3.1.156</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sourceforge.javacsv/javacsv -->
<dependency>
<groupId>net.sourceforge.javacsv</groupId>
......
......@@ -204,7 +204,7 @@ public class CallPython {
return null;
}
static String ffmpegExecute(String arg) {
public static String ffmpegExecute(String arg) {
// log.warn("ffmpegExecute: "+arg);
ProcessBuilder processBuilder = new ProcessBuilder(arg.split(" "));
processBuilder.redirectErrorStream(true); //错误输出流合并到标准输出流中
......@@ -224,17 +224,18 @@ public class CallPython {
log.error("ffmpeg执行出错:{}",builder.toString());
return "0";
}
} else {
while ((line = reader.readLine()) != null) {
// builder.append(line);
}
// else {
// while ((line = reader.readLine()) != null) {
// builder.append(line);
// }
// if (builder.length() != 0){
// log.info("ffmpeg返回信息:{}", builder.toString());
// }
}
// }
//log.info(Thread.currentThread().getName()+"耗时:"+(System.currentTimeMillis()-startTime));
} catch (IOException | InterruptedException e) {
log.info("Error while running ffmpeg. {}",e.getMessage());
log.error("Error while running ffmpeg. {}",e.getMessage());
return "0";
} finally {
if (process != null) process.destroy();
......
......@@ -41,6 +41,17 @@ public interface TTSConstants {
String AUTHORIZATION = "Bearer ";
}
interface TENCENT_AUDIO_ID {
String APP_ID = "2159149523";
String App_Key_WITH_PREFIX = "&app_key=lqpqxEo6p2xQSILQ";
}
interface TENCENT_PROFESSION_TTS_ID {
String APP_ID = "1304075838";
String SECRET_ID = "AKIDjfMnytjxiFXa9UEs61hcIn4Zs0tc5ui0";
String SECRET_KEY = "DqQkqcBWbU8oEPay96OSTEi1OVOegU0p";
}
interface Audio {
String XIAOAI = "XIAOAI";
String XIAODU = "XIAODU";
......
......@@ -3,6 +3,7 @@ package ai.qiwu.com.tts_service.controller;
import ai.qiwu.com.tts_service.common.*;
import ai.qiwu.com.tts_service.pojo.*;
import ai.qiwu.com.tts_service.pojo.upload.UploadOneSenData;
import ai.qiwu.com.tts_service.repository.SpeakerInfoRepository;
import ai.qiwu.com.tts_service.service.*;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
......@@ -61,6 +62,9 @@ public class TTSController {
private final LieHuSchedule lieHuSchedule;
@Autowired
public SpeakerInfoRepository speakerInfoRepository;
// private final CdnService cdnService;
@Autowired
......@@ -93,6 +97,32 @@ public class TTSController {
return new SpeakersApiRes(Initialize.getPersonInfoOnline(), Initialize.getPersonInfoOffline());
}
// @GetMapping("/api/speakers/back")
// public Integer speakers_api_back() {
// String response = ApachHttpUtils.get("http://localhost:9664/api/speakers", null, null);
// TempSpeakersApi speakersApiRes = JSON.parseObject(response, TempSpeakersApi.class);
// TempPersonInfo personInfo;
// int count = 0;
//// for (Map.Entry<String, TempPersonInfo> entry: speakersApiRes.getOnline().entrySet()) {
//// personInfo = entry.getValue();
//// for (String mood: personInfo.getMood()) {
//// speakerInfoRepository.updateName(personInfo.getName(), entry.getKey(), mood, personInfo.getSex());
//// count++;
//// }
//// }
// String offline;
// for (Map.Entry<String, TempPersonInfo> entry: speakersApiRes.getOffline().entrySet()) {
// personInfo = entry.getValue();
// offline = entry.getKey();
// offline = offline.substring(0, offline.lastIndexOf("_"));
// for (String mood: personInfo.getMood()) {
// speakerInfoRepository.updateName(personInfo.getName(), offline, mood, personInfo.getSex());
// count++;
// }
// }
// return count;
// }
/**
* /api/tts 接口的get请求,根据信息返回文件或该文件的请求链接
* @param person 对应的人物代号
......
package ai.qiwu.com.tts_service.controller;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
/**
* painter
* 20-10-30 下午9:30
*/
@Getter
@Setter
@ToString
public class TempPersonInfo {
private String name;
private String sex;
private List<String> mood;
private Boolean third_party;
}
package ai.qiwu.com.tts_service.controller;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.Map;
/**
* painter
* 20-10-30 下午9:29
*/
@Getter
@Setter
@ToString
public class TempSpeakersApi {
private Map<String, TempPersonInfo> online;
private Map<String, TempPersonInfo> offline;
}
......@@ -21,4 +21,6 @@ public class SpeakersApiRes {
this.online = online;
this.offline = offline;
}
public SpeakersApiRes(){}
}
package ai.qiwu.com.tts_service.pojo.third;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
/**
* painter
* 20-10-30 下午2:37
*/
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
public class TecentTTSResponse {
private Integer ret;
private String msg;
private TecentTTSResponseData data;
}
package ai.qiwu.com.tts_service.pojo.third;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
/**
* painter
* 20-10-30 下午2:38
*/
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
public class TecentTTSResponseData {
private Integer format;
private String speech;
private String md5sum;
private String voice;
}
package ai.qiwu.com.tts_service.pojo.third;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* painter
* 20-10-30 下午7:29
*/
@Getter
@Setter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class TencentProTTSData {
private TencentProTTSResponse Response;
}
package ai.qiwu.com.tts_service.pojo.third;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* painter
* 20-10-30 下午6:23
*/
@Getter
@Setter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class TencentProTTSResponse {
private String Audio;
private String RequestId;
private String SessionId;
}
......@@ -2,7 +2,10 @@ package ai.qiwu.com.tts_service.repository;
import ai.qiwu.com.tts_service.entity.SpeakersInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import javax.transaction.Transactional;
import java.util.List;
/**
......@@ -12,4 +15,9 @@ import java.util.List;
*/
public interface SpeakerInfoRepository extends JpaRepository<SpeakersInfo, Integer> {
List<SpeakersInfo> findByIsDelete(String isDelete);
@Modifying
@Transactional
@Query(value = "UPDATE speakers_info SET name=?1 where person=?2 and mood=?3 and sex=?4", nativeQuery = true)
void updateName(String name, String person, String mood, String sex);
}
......@@ -148,6 +148,8 @@ public class Initialize implements InitializingBean {
public static final String ZUUL_HOST;
public static Set<String> tencentProEnglishPerson;
// private static final int XIAODU_TEXT_SIZE_LIMIT;
// private static final int LIEHU_TEXT_SIZE_LIMIT;
......@@ -158,6 +160,7 @@ public class Initialize implements InitializingBean {
* 静态代码块
*/
static {
tencentProEnglishPerson = new HashSet<>();
URL_LS = new ArrayList<>();
THIRD_PARTY_TTS = new HashSet<>();
ONLINE_ID_2_URL = new HashMap<>();
......@@ -207,6 +210,49 @@ public class Initialize implements InitializingBean {
THIRD_PARTY_WITH_ITS_PER.put("Baidu6", "103"); //度米朵(童声)
THIRD_PARTY_WITH_ITS_PER.put("Baidu7", "5"); //度小娇(情感女)
THIRD_PARTY_WITH_ITS_PER.put("Liehu1", "1"); //猎户采采
THIRD_PARTY_WITH_ITS_PER.put("TencentAI1", "1"); //腾讯AI 中文男普通
THIRD_PARTY_WITH_ITS_PER.put("TencentAI5", "5"); //腾讯AI 静琪 女
THIRD_PARTY_WITH_ITS_PER.put("TencentAI6", "6"); //腾讯AI 欢馨 女
THIRD_PARTY_WITH_ITS_PER.put("TencentAI7", "7"); //腾讯AI 碧萱 女
THIRD_PARTY_WITH_ITS_PER.put("ProTencent0", "0"); //云小宁
THIRD_PARTY_WITH_ITS_PER.put("ProTencent1", "1"); //云小奇
THIRD_PARTY_WITH_ITS_PER.put("ProTencent2", "2"); //云小晚
THIRD_PARTY_WITH_ITS_PER.put("ProTencent4", "4"); //云小叶
THIRD_PARTY_WITH_ITS_PER.put("ProTencent5", "5"); //云小欣
THIRD_PARTY_WITH_ITS_PER.put("ProTencent6", "6"); //云小龙
THIRD_PARTY_WITH_ITS_PER.put("ProTencent7", "7"); //云小曼
THIRD_PARTY_WITH_ITS_PER.put("ProTencent8", "1000"); //智侠
THIRD_PARTY_WITH_ITS_PER.put("ProTencent9", "1001"); //智瑜
THIRD_PARTY_WITH_ITS_PER.put("ProTencent10", "1002"); //智聆
THIRD_PARTY_WITH_ITS_PER.put("ProTencent11", "1003"); //智美
THIRD_PARTY_WITH_ITS_PER.put("ProTencent12", "1050"); //WeJack
THIRD_PARTY_WITH_ITS_PER.put("ProTencent13", "1051"); //WeRose
THIRD_PARTY_WITH_ITS_PER.put("ProTencent14", "101000"); //智侠 精品
THIRD_PARTY_WITH_ITS_PER.put("ProTencent15", "101001"); //智瑜 精品
THIRD_PARTY_WITH_ITS_PER.put("ProTencent16", "101002"); //智聆 精品
THIRD_PARTY_WITH_ITS_PER.put("ProTencent17", "101003"); //智美 精品
THIRD_PARTY_WITH_ITS_PER.put("ProTencent18", "101004"); //智云
THIRD_PARTY_WITH_ITS_PER.put("ProTencent19", "101005"); //智莉
THIRD_PARTY_WITH_ITS_PER.put("ProTencent20", "101006"); //智言
THIRD_PARTY_WITH_ITS_PER.put("ProTencent21", "101007"); //智娜
THIRD_PARTY_WITH_ITS_PER.put("ProTencent22", "101008"); //智琪
THIRD_PARTY_WITH_ITS_PER.put("ProTencent23", "101009"); //智芸
THIRD_PARTY_WITH_ITS_PER.put("ProTencent24", "101010"); //智华
THIRD_PARTY_WITH_ITS_PER.put("ProTencent25", "101050"); //WeJack 精品
THIRD_PARTY_WITH_ITS_PER.put("ProTencent26", "101051"); //WeRose 精品
THIRD_PARTY_WITH_ITS_PER.put("ProTencent27", "102000"); //贝蕾
THIRD_PARTY_WITH_ITS_PER.put("ProTencent28", "102001"); //贝果
THIRD_PARTY_WITH_ITS_PER.put("ProTencent29", "102002"); //贝紫
THIRD_PARTY_WITH_ITS_PER.put("ProTencent30", "102003"); //贝雪
tencentProEnglishPerson.add("101050");
tencentProEnglishPerson.add("101051");
tencentProEnglishPerson.add("1050");
tencentProEnglishPerson.add("1051");
// THIRD_PARTY_WITH_ITS_PER.put("Liehu0", "0"); //猎户小雅
// THIRD_PARTY_WITH_ITS_PER.put("Liehu20", "20"); //猎户童音
}
......
......@@ -25,6 +25,7 @@ import java.io.*;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
......@@ -33,7 +34,7 @@ import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
......@@ -2682,7 +2683,19 @@ public class TTService {
public static void main(String[] args) throws UnsupportedEncodingException {
// String command = "soxi /home/yf01/下载/audioCut/1.mp3";
// String response = CallPython.soxiGetAudioConfig(command);
String response = "Input File : '/home/yf01/下载/audioCut/1.mp3'Channels : 1Sample Rate : 16000Precision : 16-bitDuration : 00:00:01.12 = 17856 samples ~ 83.7 CDDA sectorsFile Size : 4.46kBit Rate : 32.0kSample Encoding: MPEG audio (layer I, II or III)";
System.out.println(response);
// String response = "Input File : '/home/yf01/下载/audioCut/1.mp3'Channels : 1Sample Rate : 16000Precision : 16-bitDuration : 00:00:01.12 = 17856 samples ~ 83.7 CDDA sectorsFile Size : 4.46kBit Rate : 32.0kSample Encoding: MPEG audio (layer I, II or III)";
// System.out.println(response);
// String text = "a^d\uD83C\uDD70ccc^\uD83C\uDD71^ \uD83C\uDD70b^bb\uD83C\uDD71weg^";
// List<String> splitList = new ArrayList<>();
// String[] arr = text.split("\uD83C\uDD70");
// for (String item: arr) {
// splitList.addAll(Arrays.asList(item.split("\uD83C\uDD71")));
// }
// splitList = splitList.stream().filter(s -> StringUtils.isNotBlank(s.replaceAll("\\p{P}", ""))).collect(Collectors.toList());
// System.out.println(splitList);
// System.out.println(TTSUtils.buildMP3Filename("厉害啊!这一般人还不一定知道呢。请问,忽如一夜{/ye4/}春风来,千树万树梨花开,这一句诗写的是哪个季节的景象呢"));
System.out.println("厉害啊!".getBytes(StandardCharsets.UTF_8).length);
System.out.println("厉害啊".getBytes(StandardCharsets.UTF_8).length);
}
}
......@@ -1341,18 +1341,18 @@ public class TTServiceEdition2 {
}
public static void main(String[] args) {
final String text = "\uD83C\uDD70今天\uD83C\uDD71是第\uD83C\uDD706\uD83C\uDD71,\uD83C\uDD70文件\uD83C\uDD71天,音频\uD83C\uDD70出错\uD83C\uDD71@#";
List<String> splitList = new ArrayList<>();
String[] arr = text.split("\uD83C\uDD70");
for (String item: arr) {
splitList.addAll(Arrays.asList(item.split("\uD83C\uDD71")));
}
System.out.println(splitList);
splitList = splitList.stream().filter(s -> StringUtils.isNotBlank(s.replaceAll("\\p{P}", ""))).collect(Collectors.toList());
System.out.println(splitList);
// final String text = "\uD83C\uDD70今天\uD83C\uDD71是第\uD83C\uDD706\uD83C\uDD71,\uD83C\uDD70文件\uD83C\uDD71天,音频\uD83C\uDD70出错\uD83C\uDD71@#";
// List<String> splitList = new ArrayList<>();
// String[] arr = text.split("\uD83C\uDD70");
// for (String item: arr) {
// splitList.addAll(Arrays.asList(item.split("\uD83C\uDD71")));
// }
// System.out.println(splitList);
// splitList = splitList.stream().filter(s -> StringUtils.isNotBlank(s.replaceAll("\\p{P}", ""))).collect(Collectors.toList());
//
// System.out.println(splitList);
// System.out.println(TTSUtils.buildMP3Filename("今天是第"));
// System.out.println(TTSUtils.buildMP3Filename("天"));
// System.out.println(TTSUtils.buildMP3Filename("6"));
System.out.println(TTSUtils.buildMP3Filename("{晴天}还是{阴天}"));
}
}
......@@ -37,12 +37,12 @@ import java.util.concurrent.TimeUnit;
@Slf4j
public class XiaoDuHomeController {
public static volatile String WELCOME_NOVEL = "欢迎来到晓悟智能小说。向您推荐新上线的野蛮女友,您可以说打开野蛮女友。或者说,推荐其它作品。";
public static volatile String WELCOME_NOVEL = "欢迎来到晓悟智能小说。向您推荐新上线的妖刀异闻录,您可以说打开妖刀异闻录。或者说,推荐其它作品。";
public static volatile String WELCOME_SMART = "欢迎来到晓悟智能故事。我们新上线了遇见伽利略,你可以说打开遇见伽利略。或者说,推荐其它作品。";
public static volatile String WELCOME_SMART = "欢迎来到晓悟智能故事。我们新上线了魔法世界大冒险,你可以说打开魔法世界大冒险。或者说,推荐其它作品。";
// public static volatile String WELCOME_FORMAT = "欢迎来到交游天下。与剧情人物自由对话,带您体验不同的人生和情怀。向您推荐新上线的%s,您可以说打开%s。或者说,推荐其它作品。";
public static volatile String WELCOME_FORMAT = "欢迎来到交游天下。与剧情人物自由对话,带您体验不同的人生和情怀。向您推荐新上线的野蛮女友,您可以说打开野蛮女友。或者说,推荐其它作品。";
public static volatile String WELCOME_FORMAT = "欢迎来到交游天下。与剧情人物自由对话,带您体验不同的人生和情怀。向您推荐新上线的%s,您可以说打开%s。或者说,推荐其它作品。";
// public static volatile String WELCOME_FORMAT = "欢迎来到交游天下。与剧情人物自由对话,带您体验不同的人生和情怀。向您推荐新上线的野蛮女友,您可以说打开野蛮女友。或者说,推荐其它作品。";
private int test = 0;
......@@ -81,16 +81,16 @@ public class XiaoDuHomeController {
HttpServletRequest request = null;
try {
//log.info("--------------分界线-------------------");
// DplBotServiceBoth service = new DplBotServiceBoth((request=Utils.getHttpServletRequest()), 5, stringRedisTemplate);
Dpl2Service service = new Dpl2Service((request=Utils.getHttpServletRequest()), stringRedisTemplate);
log.info("请求信息中的attributes:{}", service.getRequest().getSession().getAttributes());
log.info(service.getStrRequest());
DplBotServiceBoth service = new DplBotServiceBoth((request=Utils.getHttpServletRequest()), 5, stringRedisTemplate);
// Dpl2Service service = new Dpl2Service((request=Utils.getHttpServletRequest()), stringRedisTemplate);
// log.info("请求信息中的attributes:{}", service.getRequest().getSession().getAttributes());
// log.info(service.getStrRequest());
//service.disableVerify();
service.enableVerify();
String str = service.run();
log.info("响应信息:{}", str);
return str;
// return service.run();
// String str = service.run();
// log.info("响应信息:{}", str);
// return str;
return service.run();
} catch (MismatchedInputException ex) {
log.info("交游探活:"+ ExceptionUtils.getStackTrace(ex));
if (test++ < 5) {
......
......@@ -117,7 +117,7 @@ public class DplBotServiceBoth extends BaseBot {
//privateKey为私钥内容,0代表你的Bot在DBP平台debug环境,1或者其他整数代表online环境,
// botMonitor对象已经在bot-sdk里初始化,可以直接调用
this.botMonitor.setEnvironmentInfo(PRIVATE_KEY, 1);
// this.botMonitor.setMonitorEnabled(true);
this.botMonitor.setMonitorEnabled(true);
}
@Override
......
......@@ -235,9 +235,15 @@ public class ScheduleServiceNew implements InitializingBean {
Map<String, List<String>> map = jsonObject.toJavaObject(Map.class);
if (map != null && map.size() != 0) {
List<String> jiaoyouList = map.get("jiaoyou-audio-adult-test");
if (!CollectionUtils.isEmpty(jiaoyouList)) map.get("jiaoyou-audio-adult-test").add("遇见伽利略");
if (!CollectionUtils.isEmpty(jiaoyouList)) {
jiaoyouList.add("遇见伽利略");
jiaoyouList.add("魔法世界大冒险");
}
List<String> xiaoaiJiaoyouList = map.get("xiaoai-jiaoyou-audio-adult-test");
if (!CollectionUtils.isEmpty(xiaoaiJiaoyouList)) map.get("xiaoai-jiaoyou-audio-adult-test").add("遇见伽利略");
if (!CollectionUtils.isEmpty(xiaoaiJiaoyouList)) {
xiaoaiJiaoyouList.add("遇见伽利略");
xiaoaiJiaoyouList.add("魔法世界大冒险");
}
jiaoyouChannel2Bots = map;
success = true;
} else {
......
......@@ -389,9 +389,9 @@ public class XiaoAiServiceRedis {
}
String response;
try {
log.info("==================\n小爱,用户话:{}, userId:{}", userWord, userId);
// log.info("==================\n小爱,用户话:{}, userId:{}", userWord, userId);
response = RequestTerminal.requestTerminate(userId, userWord, type, baseUrl);
log.info("小爱,小悟返回:{}", response);
// log.info("小爱,小悟返回:{}", response);
} catch (Exception e) {
log.error("向终端发出的请求信息失败:{}", e.toString());
return buildTextResponse(SORRY_REPEAT);
......@@ -464,7 +464,7 @@ public class XiaoAiServiceRedis {
botAccount = "empty";
}
xiaoAiResponse = buildAudioResponse((path = changeAudioUrlTemp(path, botAccount, cdnUrl)));
log.info("音频地址:"+path);
// log.info("音频地址:"+path);
if (Boolean.TRUE.equals(stringRedisTemplate.opsForValue()
.setIfPresent(SpiritRedisService.PREFIX_REDIS+userId, path, 15, TimeUnit.SECONDS))) {
log.info("xiaoai 超时redis存储成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment