Commit f64a2e4c by 苗权威

11.28

parent f8b3597c
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<module name="open" options="-parameters" /> <module name="open" options="-parameters" />
<module name="rokid" options="-parameters" /> <module name="rokid" options="-parameters" />
<module name="ruoqi" options="-parameters" /> <module name="ruoqi" options="-parameters" />
<module name="spirit" options="-parameters -extdirs /usr/local/intellij/workplace/smartbox/spirit/src/main/resources/lib" /> <module name="spirit" options="-parameters -extdirs $PROJECT_DIR$/spirit/src/main/resources/lib" />
<module name="third_party_load" options="-parameters" /> <module name="third_party_load" options="-parameters" />
<module name="tts_offline" options="-parameters" /> <module name="tts_offline" options="-parameters" />
<module name="tts_service" options="-parameters" /> <module name="tts_service" options="-parameters" />
......
...@@ -10,18 +10,22 @@ ...@@ -10,18 +10,22 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="4a2f3afc-3cd8-46bb-9e78-9759246c43dc" name="Default Changelist" comment=""> <list default="true" id="4a2f3afc-3cd8-46bb-9e78-9759246c43dc" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/OkHttp3Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/OkHttp3Utils.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/tts_service/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/CallPython.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/CallPython.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/LieHuSchedule.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/LieHuSchedule.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/Config.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/Config.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSUtils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TextInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TextInfo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/tts_service/src/main/resources/tts.properties" beforeDir="false" afterPath="$PROJECT_DIR$/tts_service/src/main/resources/deploy.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/model/request/XiaoAiRequest.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/model/request/XiaoAiRequest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/index.html" afterDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/out/" /> <ignored path="$PROJECT_DIR$/out/" />
<ignored path="$PROJECT_DIR$/target/" /> <ignored path="$PROJECT_DIR$/target/" />
...@@ -64,76 +68,41 @@ ...@@ -64,76 +68,41 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="631" column="35" selection-start-line="631" selection-start-column="35" selection-end-line="631" selection-end-column="35" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="570">
<caret line="59" column="30" selection-start-line="59" selection-start-column="16" selection-end-line="59" selection-end-column="30" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1567"> <state relative-caret-position="226">
<caret line="314" column="47" selection-start-line="314" selection-start-column="47" selection-end-line="314" selection-end-column="47" /> <caret line="318" column="52" selection-start-line="318" selection-start-column="52" selection-end-line="318" selection-end-column="52" />
<folding> <folding>
<element signature="e#11213#11214#0" expanded="true" /> <element signature="e#11568#11569#0" expanded="true" />
<element signature="e#11270#11271#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Initialize.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="246">
<caret line="156" column="74" selection-start-line="156" selection-start-column="55" selection-end-line="156" selection-end-column="74" />
<folding>
<element signature="e#10574#10575#0" expanded="true" />
<element signature="e#10616#10617#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2778"> <state relative-caret-position="132">
<caret line="264" column="80" selection-start-line="264" selection-start-column="80" selection-end-line="264" selection-end-column="80" /> <caret line="27" column="31" selection-start-line="27" selection-start-column="31" selection-end-line="27" selection-end-column="31" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="660"> <state relative-caret-position="306">
<caret line="38" column="81" selection-start-line="38" selection-start-column="81" selection-end-line="38" selection-end-column="81" /> <caret line="21" selection-start-line="21" selection-end-line="21" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220"> <state relative-caret-position="450">
<caret line="10" column="34" selection-start-line="10" selection-start-column="34" selection-end-line="10" selection-end-column="34" /> <caret line="51" column="52" lean-forward="true" selection-start-line="51" selection-start-column="52" selection-end-line="51" selection-end-column="52" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -145,34 +114,13 @@ ...@@ -145,34 +114,13 @@
<list> <list>
<option value="Enum" /> <option value="Enum" />
<option value="Interface" /> <option value="Interface" />
<option value="Class" />
<option value="HTML File" /> <option value="HTML File" />
<option value="Class" />
</list> </list>
</option> </option>
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>response.body()</find>
<find>filename</find>
<find>fileName</find>
<find>zipFolder</find>
<find>j</find>
<find>return</find>
<find>session</find>
<find>Session</find>
<find>deviceId</find>
<find>CACHE_XIAODU_REQUEST</find>
<find>onLinkAccountSucceededEvent</find>
<find>intentName</find>
<find>EXCEPT_BOT_ACCOUNT</find>
<find>dealDefaultIntent</find>
<find>userId</find>
<find>getUserId()</find>
<find>ge</find>
<find>getUserId</find>
<find>botAcc</find>
<find>response</find>
<find>shouldEndSession</find>
<find>PlaybackStarted</find> <find>PlaybackStarted</find>
<find>onPlaybackStartedEvent</find> <find>onPlaybackStartedEvent</find>
<find>data</find> <find>data</find>
...@@ -182,6 +130,27 @@ ...@@ -182,6 +130,27 @@
<find>trim()</find> <find>trim()</find>
<find>LAST_OUTTIME_RESULT</find> <find>LAST_OUTTIME_RESULT</find>
<find>onSess</find> <find>onSess</find>
<find>rootFolder</find>
<find>uploadFolder</find>
<find>botName</find>
<find>fDesiredSampleRate</find>
<find>targetFile</find>
<find>combineMp3Text2FilePath</find>
<find>file_ls</find>
<find>fTargetFrameRate</find>
<find>Rate</find>
<find>Config</find>
<find>nDesiredChannels</find>
<find>channelModeAsString</find>
<find>desiredEncoding</find>
<find>libmp3</find>
<find>audioHeader</find>
<find>desiredFileType</find>
<find>fTargetSampleRate</find>
<find>getSampleRate</find>
<find>mp3FrameHeader</find>
<find>audioInputStreamList</find>
<find>deal</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace>OPENID_CACHE</replace> <replace>OPENID_CACHE</replace>
...@@ -198,26 +167,6 @@ ...@@ -198,26 +167,6 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/third_party_load/pom.xml" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/common/config/DataSourceConfig.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/resources/application.yml" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/common/config/PrimaryConfig.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/common/config/SecondaryConfig.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/entity/xiaodu/xiaoduHistoryTB.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/repository/xiaodu/XiaoDuTBRepository.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/repository/game/GameProjectTBRepository.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/ThirdPartyLoadApplication.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/pojo/UserProfile.java" />
<option value="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/common/Code.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/Config.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSUtils.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java" />
<option value="$PROJECT_DIR$/tts_service/pom.xml" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/QiWuRequest.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/model/QiWuRequest.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java" />
<option value="$PROJECT_DIR$/xiaoduhome/pom.xml" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/config/WebSocketConfig.java" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/config/WebSocketConfig.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/application.yml" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/application.yml" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log.html" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log.html" />
...@@ -236,19 +185,39 @@ ...@@ -236,19 +185,39 @@
<option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log2.html" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log2.html" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log1.html" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log1.html" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/WebSocketLogController.java" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/WebSocketLogController.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/index.html" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/ScheduleService.java" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/ScheduleService.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/OkHttp3Utils.java" /> <option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/OkHttp3Utils.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java" /> <option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java" /> <option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/LieHuSchedule.java" /> <option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/LieHuSchedule.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java" /> <option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TextInfo.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioConvert.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioCommon.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioDecoder.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/Mp3Encoder.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/ConvertAnyAudio2Mp3.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/ConvertAudio2Mp3.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/CallPython.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSUtils.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/SampleRateConverter.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/SequenceAudioInputStream.java" />
<option value="$PROJECT_DIR$/tts_service/pom.xml" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/MixingAudioInputStream.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/MixingFloatAudioInputStream.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioConcat.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/Config.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioConverter.java" />
<option value="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/model/request/XiaoAiRequest.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java" />
<option value="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/index.html" />
</list> </list>
</option> </option>
</component> </component>
...@@ -266,15 +235,6 @@ ...@@ -266,15 +235,6 @@
<expand> <expand>
<path> <path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" /> <item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="tts_service" type="9519ce18:MavenProjectsStructure$ProjectNode" />
</path>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="tts_service" type="9519ce18:MavenProjectsStructure$ProjectNode" />
<item name="Lifecycle" type="58874e2:MavenProjectsStructure$LifecycleNode" />
</path>
<path>
<item name="" type="16c1761:MavenProjectsStructure$RootNode" />
<item name="xiaoduhome" type="9519ce18:MavenProjectsStructure$ProjectNode" /> <item name="xiaoduhome" type="9519ce18:MavenProjectsStructure$ProjectNode" />
</path> </path>
<path> <path>
...@@ -289,9 +249,9 @@ ...@@ -289,9 +249,9 @@
<component name="MavenRunner"> <component name="MavenRunner">
<option name="skipTests" value="true" /> <option name="skipTests" value="true" />
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="362" /> <option name="x" value="438" />
<option name="y" value="81" /> <option name="y" value="24" />
<option name="width" value="1377" /> <option name="width" value="1377" />
<option name="height" value="973" /> <option name="height" value="973" />
</component> </component>
...@@ -303,8 +263,6 @@ ...@@ -303,8 +263,6 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
...@@ -315,69 +273,6 @@ ...@@ -315,69 +273,6 @@
<path> <path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" /> <item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" /> <item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="controller" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="service" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="tts_service" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaoduhome" type="462c0819:PsiDirectoryNode" /> <item name="xiaoduhome" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path> <path>
...@@ -441,27 +336,12 @@ ...@@ -441,27 +336,12 @@
<item name="xiaoai" type="462c0819:PsiDirectoryNode" /> <item name="xiaoai" type="462c0819:PsiDirectoryNode" />
<item name="service" type="462c0819:PsiDirectoryNode" /> <item name="service" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaoduhome" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="smartbox" type="b2602c69:ProjectViewProjectNode" />
<item name="smartbox" type="462c0819:PsiDirectoryNode" />
<item name="xiaoduhome" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
</path>
</expand> </expand>
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="PackagesPane" />
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
...@@ -475,7 +355,7 @@ ...@@ -475,7 +355,7 @@
<property name="RequestMappingsPanelWidth2" value="75" /> <property name="RequestMappingsPanelWidth2" value="75" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" /> <property name="aspect.path.notification.shown" value="true" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1574427340128" /> <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1574923227629" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../game_editor/backend_rebuild" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/../game_editor/backend_rebuild" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" /> <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" /> <property name="nodejs_npm_path_reset_for_default_project" value="true" />
...@@ -486,13 +366,6 @@ ...@@ -486,13 +366,6 @@
<property name="settings.editor.selected.configurable" value="MavenSettings" /> <property name="settings.editor.selected.configurable" value="MavenSettings" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates" />
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/resources/static" />
<recent name="$PROJECT_DIR$/tts_service/document/start/" />
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/resources" />
<recent name="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/sound" />
</key>
<key name="MoveClassesOrPackagesDialog.RECENTS_KEY"> <key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
<recent name="ai.qiwu.com.third_party_load.entity.game" /> <recent name="ai.qiwu.com.third_party_load.entity.game" />
<recent name="ai.qiwu.com.third_party_load.repository.game" /> <recent name="ai.qiwu.com.third_party_load.repository.game" />
...@@ -500,6 +373,13 @@ ...@@ -500,6 +373,13 @@
<recent name="ai.qiwu.com.xiaoduhome.repository.primary" /> <recent name="ai.qiwu.com.xiaoduhome.repository.primary" />
<recent name="ai.qiwu.com.xiaoduhome.entity.primary" /> <recent name="ai.qiwu.com.xiaoduhome.entity.primary" />
</key> </key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/tts_service/src/main/resources/static" />
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates" />
<recent name="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/common/config" />
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common" />
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai" />
</key>
<key name="CopyClassDialog.RECENTS_KEY"> <key name="CopyClassDialog.RECENTS_KEY">
<recent name="ai.qiwu.com.third_party_load.common" /> <recent name="ai.qiwu.com.third_party_load.common" />
<recent name="ai.qiwu.com.third_party_load.entity" /> <recent name="ai.qiwu.com.third_party_load.entity" />
...@@ -507,12 +387,12 @@ ...@@ -507,12 +387,12 @@
<recent name="ai.qiwu.com.xiaoduhome.common" /> <recent name="ai.qiwu.com.xiaoduhome.common" />
<recent name="ai.qiwu.com.xiaoduhome.pojo" /> <recent name="ai.qiwu.com.xiaoduhome.pojo" />
</key> </key>
<key name="CopyFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates" /> <recent name="$PROJECT_DIR$/xiaoduhome/src/main/resources/templates" />
<recent name="$PROJECT_DIR$/third_party_load/src/main/java/ai/qiwu/com/third_party_load/common/config" /> <recent name="$PROJECT_DIR$/xiaoduhome/src/main/resources/static" />
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common" /> <recent name="$PROJECT_DIR$/tts_service/document/start/" />
<recent name="$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai" /> <recent name="$PROJECT_DIR$/xiaoduhome/src/main/resources" />
<recent name="$PROJECT_DIR$/tts_offline/src/main/java/ai/qiwu/com/tts_offline/pojo" /> <recent name="$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/sound" />
</key> </key>
</component> </component>
<component name="RunDashboard"> <component name="RunDashboard">
...@@ -528,12 +408,12 @@ ...@@ -528,12 +408,12 @@
</option> </option>
</component> </component>
<component name="RunManager" selected="Application.Test"> <component name="RunManager" selected="Application.Test">
<configuration name="Code" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="AudioConverter" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.third_party_load.common.Code" /> <option name="MAIN_CLASS_NAME" value="ai.qiwu.com.tts_service.common.sound.AudioConverter" />
<module name="third_party_load" /> <module name="tts_service" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="ai.qiwu.com.third_party_load.common.*" /> <option name="PATTERN" value="ai.qiwu.com.tts_service.common.sound.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
...@@ -541,12 +421,12 @@ ...@@ -541,12 +421,12 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Test (1)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="AudioDecoder" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.xiaoduhome.common.Test" /> <option name="MAIN_CLASS_NAME" value="ai.qiwu.com.tts_service.common.sound.AudioDecoder" />
<module name="xiaoduhome" /> <module name="tts_service" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="ai.qiwu.com.xiaoduhome.common.*" /> <option name="PATTERN" value="ai.qiwu.com.tts_service.common.sound.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
...@@ -554,12 +434,12 @@ ...@@ -554,12 +434,12 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Test" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="SampleRateConverter" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.tts_service.service.Test" /> <option name="MAIN_CLASS_NAME" value="ai.qiwu.com.tts_service.common.sound.SampleRateConverter" />
<module name="tts_service" /> <module name="tts_service" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="ai.qiwu.com.tts_service.service.*" /> <option name="PATTERN" value="ai.qiwu.com.tts_service.common.sound.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
...@@ -567,12 +447,12 @@ ...@@ -567,12 +447,12 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="UserProfile" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="Test" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ai.qiwu.com.third_party_load.pojo.UserProfile" /> <option name="MAIN_CLASS_NAME" value="ai.qiwu.com.tts_service.service.Test" />
<module name="third_party_load" /> <module name="tts_service" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="ai.qiwu.com.third_party_load.pojo.*" /> <option name="PATTERN" value="ai.qiwu.com.tts_service.service.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
...@@ -903,10 +783,10 @@ ...@@ -903,10 +783,10 @@
</configuration> </configuration>
<list> <list>
<item itemvalue="Application.Test" /> <item itemvalue="Application.Test" />
<item itemvalue="Application.Test (1)" />
<item itemvalue="Application.UserProfile" />
<item itemvalue="Application.Code" />
<item itemvalue="Application.XiaoDuHomeController" /> <item itemvalue="Application.XiaoDuHomeController" />
<item itemvalue="Application.AudioConverter" />
<item itemvalue="Application.SampleRateConverter" />
<item itemvalue="Application.AudioDecoder" />
<item itemvalue="ECS on Alibaba Cloud.dingdong" /> <item itemvalue="ECS on Alibaba Cloud.dingdong" />
<item itemvalue="ECS on Alibaba Cloud.xiaodu" /> <item itemvalue="ECS on Alibaba Cloud.xiaodu" />
<item itemvalue="ECS on Alibaba Cloud.rokid" /> <item itemvalue="ECS on Alibaba Cloud.rokid" />
...@@ -931,10 +811,10 @@ ...@@ -931,10 +811,10 @@
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Application.Test" /> <item itemvalue="Application.Test" />
<item itemvalue="Application.SampleRateConverter" />
<item itemvalue="Application.AudioDecoder" />
<item itemvalue="Application.AudioConverter" />
<item itemvalue="Application.XiaoDuHomeController" /> <item itemvalue="Application.XiaoDuHomeController" />
<item itemvalue="Application.Code" />
<item itemvalue="Application.UserProfile" />
<item itemvalue="Application.Test (1)" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
...@@ -1092,7 +972,12 @@ ...@@ -1092,7 +972,12 @@
<workItem from="1574127645437" duration="14621000" /> <workItem from="1574127645437" duration="14621000" />
<workItem from="1574214575154" duration="32315000" /> <workItem from="1574214575154" duration="32315000" />
<workItem from="1574301315953" duration="28268000" /> <workItem from="1574301315953" duration="28268000" />
<workItem from="1574401705670" duration="15294000" /> <workItem from="1574401705670" duration="15720000" />
<workItem from="1574477080071" duration="27069000" />
<workItem from="1574646831637" duration="22990000" />
<workItem from="1574857492892" duration="331000" />
<workItem from="1574859267408" duration="575000" />
<workItem from="1574919845830" duration="2558000" />
</task> </task>
<servers /> <servers />
</component> </component>
...@@ -1102,7 +987,7 @@ ...@@ -1102,7 +987,7 @@
</history-entry> </history-entry>
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="2901429000" /> <option name="totallyTimeSpent" value="2955378000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
...@@ -1114,7 +999,8 @@ ...@@ -1114,7 +999,8 @@
</todo-panel> </todo-panel>
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="362" y="81" width="1377" height="973" extended-state="0" /> <frame x="438" y="24" width="1377" height="973" extended-state="1" />
<editor active="true" />
<layout> <layout>
<window_info id="Designer" order="0" /> <window_info id="Designer" order="0" />
<window_info id="Image Layers" order="1" /> <window_info id="Image Layers" order="1" />
...@@ -1127,13 +1013,13 @@ ...@@ -1127,13 +1013,13 @@
<window_info id="Structure" order="8" sideWeight="0.5134264" weight="0.19488338" /> <window_info id="Structure" order="8" sideWeight="0.5134264" weight="0.19488338" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.25243902" /> <window_info anchor="bottom" id="Find" order="1" weight="0.25243902" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.3402439" /> <window_info anchor="bottom" id="Run" order="2" weight="0.49634147" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39885056" /> <window_info anchor="bottom" id="Debug" order="3" weight="0.39885056" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" /> <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32804877" /> <window_info anchor="bottom" id="TODO" order="6" weight="0.32804877" />
<window_info anchor="bottom" id="Spring" order="7" weight="0.32867885" /> <window_info anchor="bottom" id="Spring" order="7" weight="0.32867885" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.31463414" /> <window_info anchor="bottom" id="Terminal" order="8" weight="0.5512195" />
<window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" /> <window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" weight="0.32804877" /> <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" weight="0.32804877" />
<window_info anchor="bottom" id="Java Enterprise" order="11" /> <window_info anchor="bottom" id="Java Enterprise" order="11" />
...@@ -1144,7 +1030,7 @@ ...@@ -1144,7 +1030,7 @@
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" /> <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.24964029" /> <window_info anchor="right" id="Ant Build" order="1" weight="0.24964029" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" /> <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="Maven" order="3" visible="true" weight="0.27614748" /> <window_info anchor="right" id="Maven" order="3" weight="0.27614748" />
<window_info anchor="right" id="Palette" order="4" /> <window_info anchor="right" id="Palette" order="4" />
<window_info anchor="right" id="Capture Analysis" order="5" /> <window_info anchor="right" id="Capture Analysis" order="5" />
<window_info anchor="right" id="Palette&#9;" order="6" /> <window_info anchor="right" id="Palette&#9;" order="6" />
...@@ -1164,385 +1050,419 @@ ...@@ -1164,385 +1050,419 @@
<option name="FILTER_TARGETS" value="false" /> <option name="FILTER_TARGETS" value="false" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/request/IntentRequest.class"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/model/response/XiaoAiResponse.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198"> <state relative-caret-position="242">
<caret line="17" column="40" selection-start-line="17" selection-start-column="40" selection-end-line="17" selection-end-column="40" /> <caret line="16" column="13" selection-start-line="16" selection-start-column="13" selection-end-line="16" selection-end-column="13" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/request/RequestBody.class"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-23"> <state relative-caret-position="286">
<caret line="47" column="22" selection-start-line="47" selection-start-column="22" selection-end-line="47" selection-end-column="22" /> <caret line="113" column="37" selection-start-line="113" selection-start-column="15" selection-end-line="113" selection-end-column="37" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Utils.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="264"> <state relative-caret-position="4048">
<caret line="29" column="37" selection-start-line="29" selection-start-column="37" selection-end-line="29" selection-end-column="37" /> <caret line="202" selection-start-line="202" selection-end-line="202" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/certificate/Certificate.class"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/deploy.properties">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor" />
<state relative-caret-position="638">
<caret line="63" column="24" selection-start-line="63" selection-start-column="17" selection-end-line="63" selection-end-column="24" />
<folding>
<element signature="e#4559#4560#0" expanded="true" />
<element signature="e#4594#4595#0" expanded="true" />
</folding>
</state>
</provider>
</entry> </entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/model/Request.class"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198"> <state relative-caret-position="242">
<caret line="16" column="13" selection-start-line="16" selection-start-column="13" selection-end-line="16" selection-end-column="13" /> <caret line="108" column="36" selection-start-line="108" selection-start-column="23" selection-end-line="108" selection-end-column="36" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/WebSocketLog.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="154"> <state relative-caret-position="207">
<caret line="16" column="3" selection-start-line="16" selection-start-column="3" selection-end-line="16" selection-end-column="3" /> <caret line="633" column="13" selection-start-line="633" selection-start-column="13" selection-end-line="633" selection-end-column="13" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/entity/secondary/XiaoDuOrderTB.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Initialize.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1122"> <state relative-caret-position="3168">
<caret line="59" column="11" selection-start-line="59" selection-start-column="11" selection-end-line="59" selection-end-column="11" /> <caret line="156" column="74" selection-start-line="156" selection-start-column="55" selection-end-line="156" selection-end-column="74" />
<folding>
<element signature="e#10574#10575#0" expanded="true" />
<element signature="e#10616#10617#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/repository/secondary/XiaoDuOrderTbRepository.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TTSLSRequest.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176"> <state relative-caret-position="330">
<caret line="16" column="17" selection-start-line="16" selection-start-column="17" selection-end-line="16" selection-end-column="17" /> <caret line="20" column="21" lean-forward="true" selection-start-line="20" selection-start-column="21" selection-end-line="20" selection-end-column="21" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/entity/primary/AppFlowerTB.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/TextInfo.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="724"> <state relative-caret-position="484">
<caret line="51" column="30" lean-forward="true" selection-start-line="51" selection-start-column="30" selection-end-line="51" selection-end-column="30" /> <caret line="25" column="29" selection-start-line="25" selection-start-column="19" selection-end-line="25" selection-end-column="29" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/repository/primary/AppFlowerTBRepository.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198"> <state relative-caret-position="570">
<caret line="17" column="17" selection-start-line="17" selection-start-column="17" selection-end-line="17" selection-end-column="17" /> <caret line="59" column="30" selection-start-line="59" selection-start-column="16" selection-end-line="59" selection-end-column="30" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/repository/primary/AppFlowerTBTintRepository.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/Mp3Encoder.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198"> <state relative-caret-position="278">
<caret line="14" column="17" selection-start-line="14" selection-start-column="17" selection-end-line="14" selection-end-column="17" /> <caret line="228" column="22" lean-forward="true" selection-start-line="228" selection-start-column="22" selection-end-line="228" selection-end-column="22" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Config.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/ConvertAudio2Mp3.java" />
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioDecoder.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="515"> <state relative-caret-position="572">
<caret line="34" column="25" selection-start-line="34" selection-start-column="25" selection-end-line="34" selection-end-column="25" /> <caret line="26" column="36" selection-start-line="26" selection-start-column="36" selection-end-line="26" selection-end-column="36" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1958#1959#0" expanded="true" />
<element signature="e#2004#2005#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaodu/src/main/java/ai/qiwu/baidu/xiaodu/service/ResponseEncapsulation.java"> <entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/javax/sound/sampled/AudioSystem.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="484"> <state relative-caret-position="-3036">
<caret line="112" column="5" selection-start-line="112" selection-start-column="5" selection-end-line="112" selection-end-column="5" /> <caret line="52" column="24" selection-start-line="52" selection-start-column="13" selection-end-line="52" selection-end-column="24" />
<folding> <folding>
<element signature="e#6134#6187#0" /> <element signature="e#55308#55309#0" expanded="true" />
<element signature="e#55366#55367#0" expanded="true" />
<element signature="e#63648#63649#0" expanded="true" />
<element signature="e#63712#63713#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/repository/primary/GameProjectTbRepository.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/application.yml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/jaudiotagger/2.0.3/jaudiotagger-2.0.3.jar!/org/jaudiotagger/audio/AudioFile.class">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="308"> <state relative-caret-position="236">
<caret line="20" column="24" selection-start-line="20" selection-start-column="24" selection-end-line="20" selection-end-column="24" /> <caret line="69" column="98" selection-start-line="69" selection-start-column="87" selection-end-line="69" selection-end-column="98" />
<folding>
<element signature="e#1651#1652#0" expanded="true" />
<element signature="e#1690#1691#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/repository/primary/AllOnProductInfoRepository.java"> <entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/jaudiotagger/2.0.3/jaudiotagger-2.0.3.jar!/org/jaudiotagger/audio/mp3/MP3File.class">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="88"> <state relative-caret-position="132">
<caret line="8" column="3" lean-forward="true" selection-start-line="8" selection-start-column="3" selection-end-line="8" selection-end-column="3" /> <caret line="38" column="13" selection-start-line="38" selection-start-column="13" selection-end-line="38" selection-end-column="13" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/QiWuResponse.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/ChangeSound.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220"> <state relative-caret-position="182">
<caret line="13" column="24" selection-start-line="13" selection-start-column="24" selection-end-line="13" selection-end-column="24" /> <caret line="86" column="30" lean-forward="true" selection-start-line="86" selection-start-column="30" selection-end-line="86" selection-end-column="30" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log3.html"> <entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9-sources.jar!/org/apache/commons/lang3/StringUtils.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1078"> <state relative-caret-position="22">
<caret line="5" column="23" selection-start-line="5" selection-start-column="23" selection-end-line="5" selection-end-column="23" /> <caret line="8760" column="26" selection-start-line="8760" selection-start-column="26" selection-end-line="8760" selection-end-column="26" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log4.html"> <entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/lang/Object.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="352"> <state relative-caret-position="264">
<caret line="55" column="87" selection-start-line="55" selection-start-column="87" selection-end-line="55" selection-end-column="87" /> <caret line="234" column="18" selection-start-line="234" selection-start-column="18" selection-end-line="234" selection-end-column="18" />
<folding>
<element signature="e#10065#10066#0" expanded="true" />
<element signature="e#10148#10149#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log1.html"> <entry file="file://$PROJECT_DIR$/third_party_load/pom.xml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="418"> <state relative-caret-position="328">
<caret line="48" column="87" selection-start-line="48" selection-start-column="87" selection-end-line="48" selection-end-column="87" /> <caret line="84" column="21" lean-forward="true" selection-start-line="84" selection-start-column="21" selection-end-line="84" selection-end-column="21" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/Log2.html"> <entry file="file://$PROJECT_DIR$/ruoqi/pom.xml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-374"> <state relative-caret-position="-1512" />
<caret line="10" column="7" lean-forward="true" selection-start-line="10" selection-start-column="7" selection-end-line="10" selection-end-column="7" />
</state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/WebSocketLogController.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioCommon.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="594"> <state relative-caret-position="352">
<caret line="47" lean-forward="true" selection-start-line="47" selection-end-line="47" /> <caret line="19" selection-start-line="19" selection-end-line="19" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/index.html"> <entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/ws/schild/jave-core/2.7.1/jave-core-2.7.1.jar!/ws/schild/jave/AudioAttributes.class">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="284"> <state relative-caret-position="264">
<caret line="13" column="71" selection-start-line="13" selection-start-column="71" selection-end-line="13" selection-end-column="71" /> <caret line="26" column="27" selection-start-line="26" selection-start-column="27" selection-end-line="26" selection-end-column="27" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/bot/AudioPlayer.class"> <entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/jaudiotagger/2.0.3/jaudiotagger-2.0.3-sources.jar!/org/jaudiotagger/audio/AudioFile.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220"> <state relative-caret-position="378">
<caret line="35" column="45" selection-start-line="35" selection-start-column="23" selection-end-line="35" selection-end-column="45" /> <caret line="83" column="52" selection-start-line="83" selection-start-column="41" selection-end-line="83" selection-end-column="52" />
<folding>
<element signature="e#4899#4900#0" expanded="true" />
<element signature="e#4933#4934#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/data/request/videoplayer/event/PlaybackStartedEvent.class"> <entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/jaudiotagger/2.0.3/jaudiotagger-2.0.3-sources.jar!/org/jaudiotagger/audio/mp3/MP3File.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220"> <state relative-caret-position="308">
<caret line="16" column="13" selection-start-line="16" selection-start-column="13" selection-end-line="16" selection-end-column="13" /> <caret line="491" column="38" lean-forward="true" selection-start-line="491" selection-start-column="38" selection-end-line="491" selection-end-column="38" />
<folding>
<element signature="e#17471#17472#0" expanded="true" />
<element signature="e#17527#17528#0" expanded="true" />
<element signature="e#28665#28666#0" expanded="true" />
<element signature="e#28724#28725#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/com/baidu/dueros/bot-sdk/1.2.0/bot-sdk-1.2.0.jar!/com/baidu/dueros/bot/BaseBot.class"> <entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/jaudiotagger/2.0.3/jaudiotagger-2.0.3-sources.jar!/org/jaudiotagger/audio/mp3/MPEGFrameHeader.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="236"> <state relative-caret-position="264">
<caret line="663" column="45" selection-start-line="663" selection-start-column="23" selection-end-line="663" selection-end-column="45" /> <caret line="689" column="19" selection-start-line="689" selection-start-column="19" selection-end-line="689" selection-end-column="19" />
<folding> <folding>
<element signature="e#29860#29861#0" expanded="true" /> <element signature="e#19607#19608#0" expanded="true" />
<element signature="e#29896#29897#0" expanded="true" /> <element signature="e#19649#19650#0" expanded="true" />
<element signature="e#20328#20329#0" expanded="true" />
<element signature="e#20363#20364#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/ScheduleService.java"> <entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/ws/schild/jave-core/2.7.1/jave-core-2.7.1-sources.jar!/ws/schild/jave/AudioAttributes.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4906"> <state relative-caret-position="-74">
<caret line="257" column="44" selection-start-line="257" selection-start-column="44" selection-end-line="257" selection-end-column="44" /> <caret line="47" column="20" selection-start-line="47" selection-start-column="20" selection-end-line="47" selection-end-column="20" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplbotServiceUtil.java"> <entry file="jar://$PROJECT_DIR$/../../../../maven/myRepository/org/jaudiotagger/2.0.3/jaudiotagger-2.0.3-sources.jar!/org/jaudiotagger/audio/mp3/MP3AudioHeader.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1166"> <state relative-caret-position="276">
<caret line="101" column="34" selection-start-line="101" selection-start-column="18" selection-end-line="101" selection-end-column="34" /> <caret line="658" column="44" selection-start-line="658" selection-start-column="30" selection-end-line="658" selection-end-column="44" />
<folding>
<element signature="e#23846#23847#0" expanded="true" />
<element signature="e#23876#23877#0" expanded="true" />
<element signature="e#24482#24483#0" expanded="true" />
<element signature="e#24537#24538#0" expanded="true" />
<element signature="e#24637#24638#0" expanded="true" />
<element signature="e#24708#24709#0" expanded="true" />
<element signature="e#25324#25325#0" expanded="true" />
<element signature="e#25386#25387#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/pojo/OverTimeDetail.java"> <entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/javax/sound/sampled/AudioFormat.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286"> <state relative-caret-position="264">
<caret line="22" column="11" selection-start-line="22" selection-start-column="11" selection-end-line="22" selection-end-column="11" /> <caret line="448" column="19" selection-start-line="448" selection-start-column="19" selection-end-line="448" selection-end-column="19" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/pojo/OnlineCache.java"> <entry file="file://$PROJECT_DIR$/tts_service/pom.xml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242"> <state relative-caret-position="375">
<caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" /> <caret line="137" column="28" lean-forward="true" selection-start-line="137" selection-start-column="28" selection-end-line="137" selection-end-column="28" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://$PROJECT_DIR$/../../../../java/jdk1.8.0_211/src.zip!/java/util/concurrent/ConcurrentHashMap.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/MixingFloatAudioInputStream.java" />
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/MixingAudioInputStream.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="264"> <state relative-caret-position="264">
<caret line="1004" column="13" selection-start-line="1004" selection-start-column="13" selection-end-line="1004" selection-end-column="13" /> <caret line="24" column="11" selection-start-line="24" selection-start-column="11" selection-end-line="24" selection-end-column="11" />
<folding> <folding>
<element signature="e#44347#44348#0" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#44395#44396#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/model/response/innerResponse/directive/Directive.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioConcat.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242"> <state relative-caret-position="4356">
<caret line="15" column="13" selection-start-line="15" selection-start-column="13" selection-end-line="15" selection-end-column="13" /> <caret line="198" column="47" lean-forward="true" selection-start-line="198" selection-start-column="47" selection-end-line="198" selection-end-column="47" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#5477#5478#0" expanded="true" />
<element signature="e#5523#5524#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/ttsTest.properties">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/ttsDidi.properties">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSConstants.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSConstants.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="614"> <state relative-caret-position="595">
<caret line="38" column="70" selection-start-line="38" selection-start-column="70" selection-end-line="38" selection-end-column="70" /> <caret line="39" column="15" selection-start-line="39" selection-start-column="15" selection-end-line="39" selection-end-column="15" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/OkHttp3Utils.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/Config.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="256"> <state relative-caret-position="440">
<caret line="70" column="25" selection-start-line="70" selection-start-column="25" selection-end-line="70" selection-end-column="25" /> <caret line="31" column="37" lean-forward="true" selection-start-line="31" selection-start-column="37" selection-end-line="31" selection-end-column="37" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/model/response/XiaoAiResponse.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/AudioConverter.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242"> <state relative-caret-position="330">
<caret line="16" column="13" selection-start-line="16" selection-start-column="13" selection-end-line="16" selection-end-column="13" /> <caret line="17" column="36" selection-start-line="17" selection-start-column="36" selection-end-line="17" selection-end-column="36" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286"> <state relative-caret-position="26686">
<caret line="113" column="37" selection-start-line="113" selection-start-column="15" selection-end-line="113" selection-end-column="37" /> <caret line="1242" column="46" selection-start-line="1242" selection-start-column="46" selection-end-line="1242" selection-end-column="46" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="792"> <state relative-caret-position="2090">
<caret line="51" column="47" selection-start-line="51" selection-start-column="47" selection-end-line="51" selection-end-column="47" /> <caret line="108" column="88" selection-start-line="108" selection-start-column="88" selection-end-line="108" selection-end-column="88" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/controller/TTSController.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/LieHuSchedule.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4048"> <state relative-caret-position="1408">
<caret line="202" selection-start-line="202" selection-end-line="202" /> <caret line="74" column="28" selection-start-line="74" selection-start-column="28" selection-end-line="74" selection-end-column="28" />
<folding>
<element signature="e#2812#2813#0" expanded="true" />
<element signature="e#2847#2848#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/TTSUtils.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="660"> <state relative-caret-position="10120">
<caret line="38" column="81" selection-start-line="38" selection-start-column="81" selection-end-line="38" selection-end-column="81" /> <caret line="485" column="23" selection-start-line="485" selection-start-column="23" selection-end-line="485" selection-end-column="23" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/CallPython.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220"> <state relative-caret-position="1386">
<caret line="10" column="34" selection-start-line="10" selection-start-column="34" selection-end-line="10" selection-end-column="34" /> <caret line="69" selection-start-line="69" selection-end-line="69" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/SequenceAudioInputStream.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2778"> <state relative-caret-position="132">
<caret line="264" column="80" selection-start-line="264" selection-start-column="80" selection-end-line="264" selection-end-column="80" /> <caret line="15" column="64" lean-forward="true" selection-start-line="15" selection-start-column="64" selection-end-line="15" selection-end-column="64" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/resources/tts.properties"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Test.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/Initialize.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="246"> <state relative-caret-position="866">
<caret line="156" column="74" selection-start-line="156" selection-start-column="55" selection-end-line="156" selection-end-column="74" /> <caret line="281" column="45" lean-forward="true" selection-start-line="281" selection-start-column="45" selection-end-line="281" selection-end-column="45" />
<folding>
<element signature="e#10574#10575#0" expanded="true" />
<element signature="e#10616#10617#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java"> <entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/common/sound/SampleRateConverter.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225"> <state relative-caret-position="724">
<caret line="1747" column="79" selection-start-line="1747" selection-start-column="79" selection-end-line="1747" selection-end-column="79" /> <caret line="78" column="29" selection-start-line="78" selection-start-column="29" selection-end-line="78" selection-end-column="29" />
<folding> <folding>
<element signature="e#29333#29382#0" /> <element signature="imports" expanded="true" />
<element signature="e#64222#64231#0" /> <element signature="e#13647#13648#0" expanded="true" />
<element signature="e#83626#83660#0" /> <element signature="e#13693#13694#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/LieHuSchedule.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/model/request/XiaoAiRequest.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="482"> <state relative-caret-position="418">
<caret line="47" column="53" selection-start-line="47" selection-start-column="53" selection-end-line="47" selection-end-column="53" /> <caret line="25" column="56" selection-start-line="25" selection-start-column="56" selection-end-line="25" selection-end-column="56" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tts_service/src/main/java/ai/qiwu/com/tts_service/service/baidu/ThirdPartyService.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/resources/templates/index.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1576"> <state relative-caret-position="308">
<caret line="108" column="89" selection-start-line="108" selection-start-column="89" selection-end-line="108" selection-end-column="89" /> <caret line="14" column="79" selection-start-line="14" selection-start-column="79" selection-end-line="14" selection-end-column="79" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/XiaoAiConstants.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1567"> <state relative-caret-position="306">
<caret line="314" column="47" selection-start-line="314" selection-start-column="47" selection-end-line="314" selection-end-column="47" /> <caret line="21" selection-start-line="21" selection-end-line="21" />
<folding>
<element signature="e#11213#11214#0" expanded="true" />
<element signature="e#11270#11271#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242"> <state relative-caret-position="450">
<caret line="108" column="36" selection-start-line="108" selection-start-column="23" selection-end-line="108" selection-end-column="36" /> <caret line="51" column="52" lean-forward="true" selection-start-line="51" selection-start-column="52" selection-end-line="51" selection-end-column="52" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/service/XiaoAiService.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="570"> <state relative-caret-position="226">
<caret line="59" column="30" selection-start-line="59" selection-start-column="16" selection-end-line="59" selection-end-column="30" /> <caret line="318" column="52" selection-start-line="318" selection-start-column="52" selection-end-line="318" selection-end-column="52" />
<folding>
<element signature="e#11568#11569#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java"> <entry file="file://$PROJECT_DIR$/xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/xiaoai/common/RequestTerminal.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163"> <state relative-caret-position="132">
<caret line="631" column="35" selection-start-line="631" selection-start-column="35" selection-end-line="631" selection-end-column="35" /> <caret line="27" column="31" selection-start-line="27" selection-start-column="31" selection-end-line="27" selection-end-column="31" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
......
...@@ -104,6 +104,38 @@ ...@@ -104,6 +104,38 @@
<artifactId>commons-csv</artifactId> <artifactId>commons-csv</artifactId>
<version>1.7</version> <version>1.7</version>
</dependency> </dependency>
<!--&lt;!&ndash; https://mvnrepository.com/artifact/gnu.getopt/java-getopt &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>gnu.getopt</groupId>-->
<!--<artifactId>java-getopt</artifactId>-->
<!--<version>1.0.13</version>-->
<!--</dependency>-->
<!-- https://mvnrepository.com/artifact/ws.schild/jave-all-deps -->
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-all-deps</artifactId>
<version>2.7.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org/jaudiotagger -->
<dependency>
<groupId>org</groupId>
<artifactId>jaudiotagger</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>com.jave</groupId>
<artifactId>jave</artifactId>
<version>1.0.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/static/jave-1.0.2.jar</systemPath>
</dependency>
<!--<dependency>-->
<!--<groupId>org.tritonus.share</groupId>-->
<!--<artifactId>tritonus</artifactId>-->
<!--<version>0.3.6</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/src/main/resources/static/tritonus_share-0.3.6.jar</systemPath>-->
<!--</dependency>-->
</dependencies> </dependencies>
<build> <build>
...@@ -112,6 +144,9 @@ ...@@ -112,6 +144,9 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
......
...@@ -43,6 +43,13 @@ public class CallPython { ...@@ -43,6 +43,13 @@ public class CallPython {
return result; return result;
} }
public static String wav2Mp3(String wavPath, String mp3Path) {
execute(new StringBuilder("sox ").append(wavPath).append(" ").append(mp3Path).toString());
if (TTSUtils.doesFileExist(mp3Path)) return mp3Path;
log.error("调用sox 转wav为mp3失败");
return null;
}
/** /**
* 调用python来合成mp3 * 调用python来合成mp3
* @param wav_filename wav文件地址 * @param wav_filename wav文件地址
...@@ -67,7 +74,7 @@ public class CallPython { ...@@ -67,7 +74,7 @@ public class CallPython {
*/ */
public static void getPythonInterpreter() { public static void getPythonInterpreter() {
String interpreter = processUtil("pipenv run which python"); String interpreter = processUtil("pipenv run which python");
log.info("获取的python解释器位置:{}", interpreter); log.warn("获取的python解释器位置:{}", interpreter);
if (StringUtils.isNotBlank(interpreter)) INTERPRETER = interpreter; if (StringUtils.isNotBlank(interpreter)) INTERPRETER = interpreter;
} }
......
...@@ -20,7 +20,7 @@ public class Config { ...@@ -20,7 +20,7 @@ public class Config {
private static Properties properties; private static Properties properties;
static { static {
// String filename = "tts.properties"; // String filename = "deploy.properties";
// String filename = "ttsDidi.properties"; // String filename = "ttsDidi.properties";
// String filename = "ttsTest.properties"; // String filename = "ttsTest.properties";
String filename = "deploy.properties"; String filename = "deploy.properties";
...@@ -29,7 +29,7 @@ public class Config { ...@@ -29,7 +29,7 @@ public class Config {
// properties.load(new InputStreamReader(Objects.requireNonNull(Config.class.getClassLoader().getResourceAsStream(filename)), StandardCharsets.UTF_8)); // properties.load(new InputStreamReader(Objects.requireNonNull(Config.class.getClassLoader().getResourceAsStream(filename)), StandardCharsets.UTF_8));
String path = System.getProperty("java.class.path"); String path = System.getProperty("java.class.path");
path = path.substring(0, path.lastIndexOf(File.separator)+1) + filename; path = path.substring(0, path.lastIndexOf(File.separator)+1) + filename;
log.info("配置文件:{}",path); log.warn("配置文件:{}",path);
properties.load(new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8)); properties.load(new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8));
} catch (Exception e) { } catch (Exception e) {
log.error("获取配置文件对象出错:{}", e.toString()); log.error("获取配置文件对象出错:{}", e.toString());
......
package ai.qiwu.com.tts_service.common; package ai.qiwu.com.tts_service.common;
import ai.qiwu.com.tts_service.common.sound.SampleRateConverter;
import ai.qiwu.com.tts_service.pojo.TTSRequest; import ai.qiwu.com.tts_service.pojo.TTSRequest;
import ai.qiwu.com.tts_service.service.Initialize; import ai.qiwu.com.tts_service.service.Initialize;
import ai.qiwu.com.tts_service.service.TTService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFileFormat;
...@@ -482,9 +485,18 @@ public class TTSUtils { ...@@ -482,9 +485,18 @@ public class TTSUtils {
*/ */
public static void combineMp3File(Collection<String> filePathList, String targetFilepath) public static void combineMp3File(Collection<String> filePathList, String targetFilepath)
throws IOException { throws IOException {
try {
// List<String> filePaths = SampleRateConverter.equalSampleRate(filePathList);
// List<String> filePaths = SampleRateConverter.equalWavData(filePathList);
List<String> filePaths = SampleRateConverter.equalSampleRateUseFfmepg(filePathList);
if (!CollectionUtils.isEmpty(filePaths)) filePathList = filePaths;
} catch (Exception e) {
log.error("转换采样率出现错误:{}",e);
}
try (BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(new File(targetFilepath)))){ try (BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(new File(targetFilepath)))){
AudioEnumeration<InputStream> audioEnumeration = new AudioEnumeration<>(); AudioEnumeration<InputStream> audioEnumeration = new AudioEnumeration<>();
for (String filepath : filePathList) { for (String filepath : filePathList) {
// log.warn(filepath);
if (filepath.equals(Initialize.getThirdParty())) { if (filepath.equals(Initialize.getThirdParty())) {
continue; continue;
} }
...@@ -499,6 +511,16 @@ public class TTSUtils { ...@@ -499,6 +511,16 @@ public class TTSUtils {
outputStream.flush(); outputStream.flush();
sequenceInputStream.close(); sequenceInputStream.close();
} }
final List<String> check = new ArrayList<>(filePathList);
TTService.POOL.submit(() -> {
for (String path: check) {
if (StringUtils.endsWith(path, SampleRateConverter.SUFFIX_MP3)) {
if (!new File(path).delete()) log.error("删除采样率mp3出错:{}",path);
// String wavTempPath = path.substring(0, path.length()-8)+SampleRateConverter.SUFFIX_WAV;
// if (!new File(wavTempPath).delete()) log.error("删除采样率wav出错:{}",wavTempPath);
}
}
});
} }
/** /**
......
package ai.qiwu.com.tts_service.common.sound;
import javax.sound.sampled.*;
/**
* @dateTime 19-11-23 下午2:24
*/
public class AudioCommon {
private static boolean DEBUG = false;
public static void setDebug(boolean bDebug)
{
DEBUG = bDebug;
}
/** TODO:
*/
public static void listSupportedTargetTypes()
{
String strMessage = "Supported target types:";
AudioFileFormat.Type[] aTypes = AudioSystem.getAudioFileTypes();
for (int i = 0; i < aTypes.length; i++)
{
strMessage += " " + aTypes[i].getExtension();
}
out(strMessage);
}
/** Trying to get an audio file type for the passed extension.
This works by examining all available file types. For each
type, if the extension this type promisses to handle matches
the extension we are trying to find a type for, this type is
returned.
If no appropriate type is found, null is returned.
*/
public static AudioFileFormat.Type findTargetType(String strExtension)
{
AudioFileFormat.Type[] aTypes = AudioSystem.getAudioFileTypes();
for (int i = 0; i < aTypes.length; i++)
{
if (aTypes[i].getExtension().equals(strExtension))
{
return aTypes[i];
}
}
return null;
}
/** TODO:
*/
public static void listMixersAndExit()
{
out("Available Mixers:");
Mixer.Info[] aInfos = AudioSystem.getMixerInfo();
for (int i = 0; i < aInfos.length; i++)
{
out(aInfos[i].getName());
}
if (aInfos.length == 0)
{
out("[No mixers available]");
}
System.exit(0);
}
/** List Mixers.
Only Mixers that support either TargetDataLines or SourceDataLines
are listed, depending on the value of bPlayback.
*/
public static void listMixersAndExit(boolean bPlayback)
{
out("Available Mixers:");
Mixer.Info[] aInfos = AudioSystem.getMixerInfo();
for (int i = 0; i < aInfos.length; i++)
{
Mixer mixer = AudioSystem.getMixer(aInfos[i]);
Line.Info lineInfo = new Line.Info(bPlayback ?
SourceDataLine.class :
TargetDataLine.class);
if (mixer.isLineSupported(lineInfo))
{
out(aInfos[i].getName());
}
}
if (aInfos.length == 0)
{
out("[No mixers available]");
}
System.exit(0);
}
/** TODO:
This method tries to return a Mixer.Info whose name
matches the passed name. If no matching Mixer.Info is
found, null is returned.
*/
public static Mixer.Info getMixerInfo(String strMixerName)
{
Mixer.Info[] aInfos = AudioSystem.getMixerInfo();
for (int i = 0; i < aInfos.length; i++)
{
if (aInfos[i].getName().equals(strMixerName))
{
return aInfos[i];
}
}
return null;
}
/** TODO:
*/
public static TargetDataLine getTargetDataLine(String strMixerName,
AudioFormat audioFormat,
int nBufferSize)
{
/*
Asking for a line is a rather tricky thing.
We have to construct an Info object that specifies
the desired properties for the line.
First, we have to say which kind of line we want. The
possibilities are: SourceDataLine (for playback), Clip
(for repeated playback) and TargetDataLine (for
recording).
Here, we want to do normal capture, so we ask for
a TargetDataLine.
Then, we have to pass an AudioFormat object, so that
the Line knows which format the data passed to it
will have.
Furthermore, we can give Java Sound a hint about how
big the internal buffer for the line should be. This
isn't used here, signaling that we
don't care about the exact size. Java Sound will use
some default value for the buffer size.
*/
TargetDataLine targetDataLine = null;
DataLine.Info info = new DataLine.Info(TargetDataLine.class,
audioFormat, nBufferSize);
try
{
if (strMixerName != null)
{
Mixer.Info mixerInfo = getMixerInfo(strMixerName);
if (mixerInfo == null)
{
out("AudioCommon.getTargetDataLine(): mixer not found: " + strMixerName);
return null;
}
Mixer mixer = AudioSystem.getMixer(mixerInfo);
targetDataLine = (TargetDataLine) mixer.getLine(info);
}
else
{
if (DEBUG) { out("AudioCommon.getTargetDataLine(): using default mixer"); }
targetDataLine = (TargetDataLine) AudioSystem.getLine(info);
}
/*
* The line is there, but it is not yet ready to
* receive audio data. We have to open the line.
*/
if (DEBUG) { out("AudioCommon.getTargetDataLine(): opening line..."); }
targetDataLine.open(audioFormat, nBufferSize);
if (DEBUG) { out("AudioCommon.getTargetDataLine(): opened line"); }
}
catch (LineUnavailableException e)
{
if (DEBUG) { e.printStackTrace(); }
}
catch (Exception e)
{
if (DEBUG) { e.printStackTrace(); }
}
if (DEBUG) { out("AudioCommon.getTargetDataLine(): returning line: " + targetDataLine); }
return targetDataLine;
}
/** Checks if the encoding is PCM.
*/
public static boolean isPcm(AudioFormat.Encoding encoding)
{
return encoding.equals(AudioFormat.Encoding.PCM_SIGNED)
|| encoding.equals(AudioFormat.Encoding.PCM_UNSIGNED);
}
/** TODO:
*/
private static void out(String strMessage)
{
System.out.println(strMessage);
}
}
package ai.qiwu.com.tts_service.common.sound;
import lombok.extern.slf4j.Slf4j;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* 合并wav文件
* @dateTime 19-11-25 下午3:05
*/
@Slf4j
public class AudioConcat {
private static final int MODE_NONE = 0;
private static final int MODE_MIXING = 1;
private static final int MODE_FLOATMIXING = 2;
private static final int MODE_CONCATENATION = 3;
/** Flag for debugging messages.
* If true, some messages are dumped to the console
* during operation.
*/
private static boolean DEBUG = false;
public static void audioContact(List<String> sourceList, String targetPath) {
AudioFormat audioFormat = null;
List audioInputStreamList = new ArrayList();
for (String path: sourceList)
{
File soundFile = new File(path);
AudioInputStream audioInputStream = null;
try
{
audioInputStream = AudioSystem.getAudioInputStream(soundFile);
}
catch (Exception e) {
log.error("合并时获取{}音频流出错",path);
return;
}
AudioFormat format = audioInputStream.getFormat();
if (audioFormat == null)
{
audioFormat = format;
if (DEBUG) { out("AudioConcat.main(): format: " + audioFormat); }
}
else if (!audioFormat.matches(format))
{
// TODO: try to convert
out("AudioConcat.main(): WARNING: AudioFormats don't match");
out("AudioConcat.main(): master format: " + audioFormat);
out("AudioConcat.main(): this format: " + format);
}
audioInputStreamList.add(audioInputStream);
}
AudioInputStream audioInputStream = new SequenceAudioInputStream(audioFormat, audioInputStreamList);
File outputFile = new File(targetPath);
try
{
AudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, outputFile);
}
catch (IOException e)
{
e.printStackTrace();
}
if (DEBUG) { out("AudioConcat.main(): before exit"); }
System.exit(0);
}
public static void main(String[] args)
{
/** Mode of operation.
Determines what to do with the input files:
either mixing or concatenation.
*/
int nMode = MODE_NONE;
String strOutputFilename = null;
AudioFormat audioFormat = null;
List audioInputStreamList = new ArrayList();
// int nExternalBufferSize = DEFAULT_EXTERNAL_BUFFER_SIZE;
// int nInternalBufferSize = AudioSystem.NOT_SPECIFIED;
/*
* Parsing of command-line options takes place...
*/
// Getopt g = new Getopt("AudioConcat", args, "hDcmfo:");
// int c;
// while ((c = g.getopt()) != -1)
// {
// switch (c)
// {
// case 'h':
// printUsageAndExit();
//
// case 'o':
// strOutputFilename = g.getOptarg();
// if (DEBUG) { out("AudioConcat.main(): output filename: " + strOutputFilename); }
// break;
//
// case 'c':
// nMode = MODE_CONCATENATION;
// break;
//
// case 'm':
// nMode = MODE_MIXING;
// break;
//
// case 'f':
// nMode = MODE_FLOATMIXING;
// break;
//
// case 'D':
// DEBUG = true;
// break;
//
// case '?':
// printUsageAndExit();
//
// default:
// out("AudioConcat.main(): getopt() returned " + c);
// break;
// }
// }
/*
* All remaining arguments are assumed to be filenames of
* soundfiles we want to play.
*/
// String strFilename = null;
// for (int i = g.getOptind(); i < args.length; i++)
// {
// strFilename = args[i];
// File soundFile = new File(strFilename);
//
// /*
// * We have to read in the sound file.
// */
// AudioInputStream audioInputStream = null;
// try
// {
// audioInputStream = AudioSystem.getAudioInputStream(soundFile);
// }
// catch (Exception e)
// {
// /*
// * In case of an exception, we dump the exception
// * including the stack trace to the console output.
// * Then, we exit the program.
// */
// e.printStackTrace();
// System.exit(1);
// }
// AudioFormat format = audioInputStream.getFormat();
// /*
// The first input file determines the audio format. This stream's
// AudioFormat is stored. All other streams are checked against
// this format.
// */
// if (audioFormat == null)
// {
// audioFormat = format;
// if (DEBUG) { out("AudioConcat.main(): format: " + audioFormat); }
// }
// else if ( ! audioFormat.matches(format))
// {
// // TODO: try to convert
// out("AudioConcat.main(): WARNING: AudioFormats don't match");
// out("AudioConcat.main(): master format: " + audioFormat);
// out("AudioConcat.main(): this format: " + format);
// }
// audioInputStreamList.add(audioInputStream);
// }
if (audioFormat == null)
{
out("No input filenames!");
printUsageAndExit();
}
AudioInputStream audioInputStream = null;
switch (nMode)
{
case MODE_CONCATENATION:
audioInputStream = new SequenceAudioInputStream(audioFormat, audioInputStreamList);
break;
case MODE_MIXING:
audioInputStream = new MixingAudioInputStream(audioFormat, audioInputStreamList);
break;
case MODE_FLOATMIXING:
// audioInputStream = new MixingFloatAudioInputStream(audioFormat, audioInputStreamList);
break;
default:
out("you have to specify a mode (either -m or -c).");
printUsageAndExit();
}
if (strOutputFilename == null)
{
out("you have to specify an output filename (using -o <filename>).");
printUsageAndExit();
}
File outputFile = new File(strOutputFilename);
try
{
AudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, outputFile);
}
catch (IOException e)
{
e.printStackTrace();
}
if (DEBUG) { out("AudioConcat.main(): before exit"); }
System.exit(0);
}
private static void printUsageAndExit()
{
out("AudioConcat: usage:");
out("\tjava AudioConcat -h");
out("\tjava AudioConcat [-D] -c|-m|-f -o <outputfile> <inputfile> ...");
System.exit(1);
}
private static void out(String strMessage)
{
System.out.println(strMessage);
}
}
package ai.qiwu.com.tts_service.common.sound;
import javax.sound.sampled.*;
import java.io.File;
import java.io.IOException;
/**
* @dateTime 19-11-23 下午2:14
*/
public class AudioConverter {
/** Threshold for float comparisions.
If the difference between two floats is smaller than DELTA, they
are considered equal.
*/
private static final float DELTA = 1E-9F;
/** Flag for debugging messages.
* If true, some messages are dumped to the console
* during operation.
*/
private static boolean DEBUG = false;
public static void changeWavData(File sourceFile, String targetPath, float fTargetSampleRate, int channel) throws IOException, UnsupportedAudioFileException {
AudioFileFormat inputFileFormat = AudioSystem.getAudioFileFormat(sourceFile);
AudioFileFormat.Type defaultFileType = inputFileFormat.getType();
AudioInputStream stream;
stream = AudioSystem.getAudioInputStream(sourceFile);
AudioFormat format = stream.getFormat();
if (DEBUG) out("source format: " + format);
AudioFormat.Encoding desiredEncoding = format.getEncoding();
int nDesiredSampleSizeInBits = format.getSampleSizeInBits();
boolean bDesiredBigEndian = format.isBigEndian();
if (!AudioCommon.isPcm(format.getEncoding()))
{
if (DEBUG) out("converting to PCM...");
AudioFormat.Encoding targetEncoding =
(format.getSampleSizeInBits() == 8) ?
AudioFormat.Encoding.PCM_UNSIGNED :
AudioFormat.Encoding.PCM_SIGNED;
stream = convertEncoding(targetEncoding, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
if (nDesiredSampleSizeInBits == AudioSystem.NOT_SPECIFIED)
{
nDesiredSampleSizeInBits = format.getSampleSizeInBits();
}
}
if (stream.getFormat().getChannels() != channel)
{
if (DEBUG) out("converting channels...");
stream = convertChannels(channel, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
}
boolean bDoConvertSampleSize =
(stream.getFormat().getSampleSizeInBits() != nDesiredSampleSizeInBits);
boolean bDoConvertEndianess =
(stream.getFormat().isBigEndian() != bDesiredBigEndian);
if (bDoConvertSampleSize || bDoConvertEndianess)
{
if (DEBUG) out("converting sample size and endianess...");
stream = convertSampleSizeAndEndianess(nDesiredSampleSizeInBits,
bDesiredBigEndian, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
}
if (! equals(stream.getFormat().getSampleRate(), fTargetSampleRate))
{
if (DEBUG) out("converting sample rate...");
stream = convertSampleRate(fTargetSampleRate, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
}
if (! stream.getFormat().getEncoding().equals(desiredEncoding))
{
if (DEBUG) out("converting to " + desiredEncoding + "...");
stream = convertEncoding(desiredEncoding, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
}
int nWrittenBytes;
nWrittenBytes = AudioSystem.write(stream, defaultFileType, new File(targetPath));
if (DEBUG) out("Written bytes: " + nWrittenBytes);
}
public static void main(String[] args)
throws UnsupportedAudioFileException, IOException
{
/** The number of channels the audio data should be converted to.
The value is initialized to -1. This is used to represent the
condition that conversion of channels is not requested on the
command line.
*/
int nDesiredChannels = AudioSystem.NOT_SPECIFIED;
/** The sample size in bits the audio data should be converted to.
*/
int nDesiredSampleSizeInBits = AudioSystem.NOT_SPECIFIED;
/** The encoding the audio data should be converted to.
*/
AudioFormat.Encoding desiredEncoding = null;
/** The sample rate the audio data should be converted to.
*/
float fDesiredSampleRate = AudioSystem.NOT_SPECIFIED;
/** The file type that should be used to write the audio data.
*/
AudioFileFormat.Type desiredFileType = null;
/** The endianess the audio data should be converted to.
This is only used if bIsEndianessDesired is true.
*/
boolean bDesiredBigEndian = false;
/** Whether conversion of endianess is desired. This flag is
necessary because the boolean variable bDesiredBigEndian
has no 'unspecified' value to signal that endianess
conversion is not desired.
*/
boolean bIsEndianessDesired = false;
/*
* Parsing of command-line options takes place...
*/
// Getopt g = new Getopt("AudioConverter", args, "hlc:s:e:f:t:BLD");
// int c;
// while ((c = g.getopt()) != -1)
// {
// switch (c)
// {
// case 'h':
// printUsageAndExit();
//
// case 'l':
// // TODO: listSupportedEncodings();
// AudioCommon.listSupportedTargetTypes();
// System.exit(0);
//
// case 'c':
// nDesiredChannels = Integer.parseInt(g.getOptarg());
// break;
//
// case 's':
// nDesiredSampleSizeInBits = Integer.parseInt(g.getOptarg());
// break;
//
// case 'e':
// String strEncodingName = g.getOptarg();
// desiredEncoding = new AudioFormat.Encoding(strEncodingName);
// break;
//
// case 'f':
// fDesiredSampleRate = Float.parseFloat(g.getOptarg());
// break;
//
// case 't':
// String strExtension = g.getOptarg();
// desiredFileType = AudioCommon.findTargetType(strExtension);
// if (desiredFileType == null)
// {
// out("Unknown target file type. Check with 'AudioConverter -l'.");
// System.exit(1);
// }
// break;
//
// case 'B':
// bDesiredBigEndian = true;
// bIsEndianessDesired = true;
// break;
//
// case 'L':
// bDesiredBigEndian = true;
// bIsEndianessDesired = true;
// break;
//
// case 'D':
// DEBUG = true;
// break;
//
// case '?':
// printUsageAndExit();
//
// default:
// out("getopt() returned " + c);
// break;
// }
// }
/* We make shure that there are only two more arguments, which
we take as the input and output filenames. */
// if (args.length - g.getOptind() < 2)
// {
// printUsageAndExit();
// }
// File inputFile = new File(args[g.getOptind()]);
// File outputFile = new File(args[g.getOptind() + 1]);
File inputFile = new File("/home/yf01/下载/tts/4.wav");
File outputFile = new File("/home/yf01/下载/tts/4Change.wav");
/* As default for the audio file type we use the one of the
source file. So we first have to find out about the source
file's properties.
*/
AudioFileFormat inputFileFormat = AudioSystem.getAudioFileFormat(inputFile);
AudioFileFormat.Type defaultFileType = inputFileFormat.getType();
/* Here, we are reading the source file.
*/
AudioInputStream stream = null;
stream = AudioSystem.getAudioInputStream(inputFile);
AudioFormat format = stream.getFormat();
if (DEBUG) out("source format: " + format);
AudioFormat targetFormat = null;
/* To ease our job later, we fill the values of the AudioFormat
properties not required with the values of the source format.
*/
if (desiredEncoding == null)
{
desiredEncoding = format.getEncoding();
}
if (fDesiredSampleRate == AudioSystem.NOT_SPECIFIED)
{
// fDesiredSampleRate = format.getSampleRate();
fDesiredSampleRate = 48000;
}
if (nDesiredSampleSizeInBits == AudioSystem.NOT_SPECIFIED)
{
nDesiredSampleSizeInBits = format.getSampleSizeInBits();
}
if (nDesiredChannels == AudioSystem.NOT_SPECIFIED)
{
nDesiredChannels = format.getChannels();
}
if (! bIsEndianessDesired)
{
bDesiredBigEndian = format.isBigEndian();
}
/* Step 1: convert to PCM, if necessary.
*/
if (!AudioCommon.isPcm(format.getEncoding()))
{
if (DEBUG) out("converting to PCM...");
/* The following is a heuristics: normally (but not always),
8 bit audio data are unsigned, while 16 bit data are signed.
*/
AudioFormat.Encoding targetEncoding =
(format.getSampleSizeInBits() == 8) ?
AudioFormat.Encoding.PCM_UNSIGNED :
AudioFormat.Encoding.PCM_SIGNED;
stream = convertEncoding(targetEncoding, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
/* Here, we handle a special case: some compressed formats
do not state a sample size (but AudioSystem.NOT_SPECIFIED)
because its unknown how long
the samples are after decoding. If no sample size has been
requested with a command line option,
In this case, nDesiredSampleSizeInBits still has the value
AudioSystem.NOT_SPECIFIED despite the filling with default
values above.
*/
if (nDesiredSampleSizeInBits == AudioSystem.NOT_SPECIFIED)
{
nDesiredSampleSizeInBits = format.getSampleSizeInBits();
}
}
/* Step 2: convert number of channels, if necessary.
*/
if (stream.getFormat().getChannels() != nDesiredChannels)
{
if (DEBUG) out("converting channels...");
stream = convertChannels(nDesiredChannels, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
}
/* Step 3: convert sample size and endianess, if necessary.
*/
boolean bDoConvertSampleSize =
(stream.getFormat().getSampleSizeInBits() != nDesiredSampleSizeInBits);
boolean bDoConvertEndianess =
(stream.getFormat().isBigEndian() != bDesiredBigEndian);
if (bDoConvertSampleSize || bDoConvertEndianess)
{
if (DEBUG) out("converting sample size and endianess...");
stream = convertSampleSizeAndEndianess(nDesiredSampleSizeInBits,
bDesiredBigEndian, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
}
/* Step 4: convert sample rate, if necessary.
*/
if (! equals(stream.getFormat().getSampleRate(), fDesiredSampleRate))
{
if (DEBUG) out("converting sample rate...");
stream = convertSampleRate(fDesiredSampleRate, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
}
/* Step 5: convert to non-PCM encoding, if necessary.
*/
if (! stream.getFormat().getEncoding().equals(desiredEncoding))
{
if (DEBUG) out("converting to " + desiredEncoding + "...");
stream = convertEncoding(desiredEncoding, stream);
if (DEBUG) out("stream: " + stream);
if (DEBUG) out("format: " + stream.getFormat());
}
/* Since we now know that we are dealing with PCM, we know
that the frame rate is the same as the sample rate.
*/
// float fTargetFrameRate = fTargetSampleRate;
// /* Here, we are constructing the desired format of the
// audio data (as the result of the conversion should be).
// We take over all values besides the sample/frame rate.
// */
/* And finally, we are trying to write the converted audio
data to a new file.
*/
int nWrittenBytes = 0;
AudioFileFormat.Type targetFileType = (desiredFileType != null) ?
desiredFileType : defaultFileType;
nWrittenBytes = AudioSystem.write(stream, targetFileType, outputFile);
if (DEBUG) out("Written bytes: " + nWrittenBytes);
}
private static AudioInputStream convertEncoding(
AudioFormat.Encoding targetEncoding,
AudioInputStream sourceStream)
{
return AudioSystem.getAudioInputStream(targetEncoding,
sourceStream);
}
private static AudioInputStream convertChannels(
int nChannels,
AudioInputStream sourceStream)
{
AudioFormat sourceFormat = sourceStream.getFormat();
AudioFormat targetFormat = new AudioFormat(
sourceFormat.getEncoding(),
sourceFormat.getSampleRate(),
sourceFormat.getSampleSizeInBits(),
nChannels,
calculateFrameSize(nChannels,
sourceFormat.getSampleSizeInBits()),
sourceFormat.getFrameRate(),
sourceFormat.isBigEndian());
return AudioSystem.getAudioInputStream(targetFormat,
sourceStream);
}
private static AudioInputStream convertSampleSizeAndEndianess(
int nSampleSizeInBits,
boolean bBigEndian,
AudioInputStream sourceStream)
{
AudioFormat sourceFormat = sourceStream.getFormat();
AudioFormat targetFormat = new AudioFormat(
sourceFormat.getEncoding(),
sourceFormat.getSampleRate(),
nSampleSizeInBits,
sourceFormat.getChannels(),
calculateFrameSize(sourceFormat.getChannels(),
nSampleSizeInBits),
sourceFormat.getFrameRate(),
bBigEndian);
return AudioSystem.getAudioInputStream(targetFormat,
sourceStream);
}
private static AudioInputStream convertSampleRate(
float fSampleRate,
AudioInputStream sourceStream)
{
AudioFormat sourceFormat = sourceStream.getFormat();
AudioFormat targetFormat = new AudioFormat(
sourceFormat.getEncoding(),
fSampleRate,
sourceFormat.getSampleSizeInBits(),
sourceFormat.getChannels(),
sourceFormat.getFrameSize(),
fSampleRate,
sourceFormat.isBigEndian());
return AudioSystem.getAudioInputStream(targetFormat,
sourceStream);
}
private static int calculateFrameSize(int nChannels, int nSampleSizeInBits)
{
return ((nSampleSizeInBits + 7) / 8) * nChannels;
}
/** Compares two float values for equality.
*/
private static boolean equals(float f1, float f2)
{
return (Math.abs(f1 - f2) < DELTA);
}
private static void printUsageAndExit()
{
out("AudioConverter: usage:");
out("\tjava AudioConverter -h");
out("\tjava AudioConverter -l");
out("\tjava AudioConverter");
out("\t\t[-c <channels>]");
out("\t\t[-s <sample_size_in_bits>]");
out("\t\t[-e <encoding>]");
out("\t\t[-f <sample_rate>]");
out("\t\t[-t <file_type>]");
out("\t\t[-B|-L] [-D]");
out("\t\t<sourcefile> <targetfile>");
System.exit(1);
}
private static void out(String strMessage)
{
System.out.println(strMessage);
}
}
package ai.qiwu.com.tts_service.common.sound;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import java.io.File;
import java.io.IOException;
/**
* @dateTime 19-11-23 下午3:47
*/
public class AudioDecoder {
private static final boolean DEBUG = false;
public static void main(String[] args)
{
// if (args.length != 2)
// {
// printUsageAndExit();
// }
// File encodedFile = new File(args[0]);
// File pcmFile = new File(args[1]);
File encodedFile = new File("/home/yf01/下载/tts/4.wav");
File pcmFile = new File("/home/yf01/下载/tts/4.pcm");
AudioInputStream ais = null;
try
{
ais = AudioSystem.getAudioInputStream(encodedFile);
}
catch (Exception e)
{
e.printStackTrace();
}
if (ais == null)
{
out("cannot open input file");
System.exit(1);
}
if (DEBUG) { out("AudioDecoder: ais: " + ais); }
if (DEBUG) { out("AudioDecoder: ais AudioFormat: " + ais.getFormat()); }
if (DEBUG) { out("AudioDecoder: ais length (frames): " + ais.getFrameLength()); }
AudioFormat.Encoding targetEncoding = AudioFormat.Encoding.PCM_SIGNED;
AudioInputStream pcmAIS = AudioSystem.getAudioInputStream(targetEncoding, ais);
if (DEBUG) { out("AudioDecoder: pcmAIS: " + pcmAIS); }
if (DEBUG) { out("AudioDecoder: pcmAIS AudioFormat: " + pcmAIS.getFormat()); }
if (DEBUG) { out("AudioDecoder: pcmAIS length (frames): " + pcmAIS.getFrameLength()); }
AudioFileFormat.Type fileType = AudioFileFormat.Type.AU;
int nWrittenBytes = 0;
try
{
nWrittenBytes = AudioSystem.write(pcmAIS, fileType, pcmFile);
if (DEBUG) out("AudioDecoder: written (bytes): " + nWrittenBytes);
}
catch (IOException e)
{
e.printStackTrace();
}
}
private static void printUsageAndExit()
{
out("AudioDecoder: usage:");
out("\tjava AudioDecoder <encodedfile> <pcmfile>");
System.exit(1);
}
private static void out(String strMessage)
{
System.out.println(strMessage);
}
}
package ai.qiwu.com.tts_service.common.sound;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
/**
* @author 苗权威
* @dateTime 19-11-25 下午3:08
*/
public class MixingAudioInputStream extends AudioInputStream {
private static final boolean DEBUG = false;
private List m_audioInputStreamList;
public MixingAudioInputStream(AudioFormat audioFormat, Collection audioInputStreams)
{
super(new ByteArrayInputStream(new byte[0]),
audioFormat,
AudioSystem.NOT_SPECIFIED);
if (DEBUG) { out("MixingAudioInputStream.<init>(): begin"); }
m_audioInputStreamList = new ArrayList(audioInputStreams);
if (DEBUG)
{
out("MixingAudioInputStream.<init>(): stream list:");
for (int i = 0; i < m_audioInputStreamList.size(); i++)
{
out(" " + m_audioInputStreamList.get(i));
}
}
if (DEBUG) { out("MixingAudioInputStream.<init>(): end"); }
}
/**
The maximum of the frame length of the input stream is calculated and returned.
If at least one of the input streams has length
<code>AudioInputStream.NOT_SPECIFIED</code>, this value is returned.
*/
public long getFrameLength()
{
long lLengthInFrames = 0;
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
long lLength = stream.getFrameLength();
if (lLength == AudioSystem.NOT_SPECIFIED)
{
return AudioSystem.NOT_SPECIFIED;
}
else
{
lLengthInFrames = Math.max(lLengthInFrames, lLength);
}
}
return lLengthInFrames;
}
public int read()
throws IOException
{
if (DEBUG) { out("MixingAudioInputStream.read(): begin"); }
int nSample = 0;
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
int nByte = stream.read();
if (nByte == -1)
{
/*
The end of this stream has been signaled.
We remove the stream from our list.
*/
streamIterator.remove();
continue;
}
else
{
/*
what about signed/unsigned?
*/
nSample += nByte;
}
}
if (DEBUG) { out("MixingAudioInputStream.read(): end"); }
return (byte) (nSample & 0xFF);
}
public int read(byte[] abData, int nOffset, int nLength)
throws IOException
{
if (DEBUG)
{
out("MixingAudioInputStream.read(byte[], int, int): begin");
out("MixingAudioInputStream.read(byte[], int, int): requested length: " + nLength);
}
int nChannels = getFormat().getChannels();
int nFrameSize = getFormat().getFrameSize();
/*
This value is in bytes. Note that it is the storage size.
It may be four bytes for 24 bit samples.
*/
int nSampleSize = nFrameSize / nChannels;
boolean bBigEndian = getFormat().isBigEndian();
AudioFormat.Encoding encoding = getFormat().getEncoding();
if (DEBUG)
{
out("MixingAudioInputStream.read(byte[], int, int): channels: " + nChannels);
out("MixingAudioInputStream.read(byte[], int, int): frame size: " + nFrameSize);
out("MixingAudioInputStream.read(byte[], int, int): sample size (bytes, storage size): " + nSampleSize);
out("MixingAudioInputStream.read(byte[], int, int): big endian: " + bBigEndian);
out("MixingAudioInputStream.read(byte[], int, int): encoding: " + encoding);
}
byte[] abBuffer = new byte[nFrameSize];
int[] anMixedSamples = new int[nChannels];
for (int nFrameBoundry = 0; nFrameBoundry < nLength; nFrameBoundry += nFrameSize)
{
if (DEBUG) { out("MixingAudioInputStream.read(byte[], int, int): frame boundry: " + nFrameBoundry); }
for (int i = 0; i < nChannels; i++)
{
anMixedSamples[i] = 0;
}
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
if (DEBUG)
{
out("MixingAudioInputStream.read(byte[], int, int): AudioInputStream: " + stream);
}
int nBytesRead = stream.read(abBuffer, 0, nFrameSize);
if (DEBUG)
{
out("MixingAudioInputStream.read(byte[], int, int): bytes read: " + nBytesRead);
}
/*
TODO: we have to handle incomplete reads.
*/
if (nBytesRead == -1)
{
/*
The end of the current stream has been signaled.
We remove it from the list of streams.
*/
streamIterator.remove();
continue;
}
for (int nChannel = 0; nChannel < nChannels; nChannel++)
{
int nBufferOffset = nChannel * nSampleSize;
int nSampleToAdd = 0;
if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED))
{
switch (nSampleSize)
{
case 1:
nSampleToAdd = abBuffer[nBufferOffset];
break;
case 2:
// nSampleToAdd = TConversionTool.bytesToInt16(abBuffer, nBufferOffset, bBigEndian);
break;
case 3:
// nSampleToAdd = TConversionTool.bytesToInt24(abBuffer, nBufferOffset, bBigEndian);
break;
case 4:
// nSampleToAdd = TConversionTool.bytesToInt32(abBuffer, nBufferOffset, bBigEndian);
break;
}
}
// TODO: pcm unsigned
else if (encoding.equals(AudioFormat.Encoding.ALAW))
{
// nSampleToAdd = TConversionTool.alaw2linear(abBuffer[nBufferOffset]);
}
else if (encoding.equals(AudioFormat.Encoding.ULAW))
{
// nSampleToAdd = TConversionTool.ulaw2linear(abBuffer[nBufferOffset]);
}
anMixedSamples[nChannel] += nSampleToAdd;
} // loop over channels
} // loop over streams
if (DEBUG)
{
out("MixingAudioInputStream.read(byte[], int, int): starting to write to buffer passed by caller");
}
for (int nChannel = 0; nChannel < nChannels; nChannel++)
{
if (DEBUG)
{
out("MixingAudioInputStream.read(byte[], int, int): channel: " + nChannel);
}
int nBufferOffset = nOffset + nFrameBoundry /* * nFrameSize*/ + nChannel * nSampleSize;
if (DEBUG)
{
out("MixingAudioInputStream.read(byte[], int, int): buffer offset: " + nBufferOffset);
}
if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED))
{
switch (nSampleSize)
{
case 1:
abData[nBufferOffset] = (byte) anMixedSamples[nChannel];
break;
case 2:
// TConversionTool.intToBytes16(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian);
break;
case 3:
// TConversionTool.intToBytes24(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian);
break;
case 4:
// TConversionTool.intToBytes32(anMixedSamples[nChannel], abData, nBufferOffset, bBigEndian);
break;
}
}
// TODO: pcm unsigned
else if (encoding.equals(AudioFormat.Encoding.ALAW))
{
// abData[nBufferOffset] = TConversionTool.linear2alaw((short) anMixedSamples[nChannel]);
}
else if (encoding.equals(AudioFormat.Encoding.ULAW))
{
// abData[nBufferOffset] = TConversionTool.linear2ulaw(anMixedSamples[nChannel]);
}
} // (final) loop over channels
} // loop over frames
if (DEBUG)
{
out("MixingAudioInputStream.read(byte[], int, int): end");
}
// TODO: return a useful value
return nLength;
}
/**
calls skip() on all input streams. There is no way to assure that the number of
bytes really skipped is the same for all input streams. Due to that, this
method always returns the passed value. In other words: the return value
is useless (better ideas appreciated).
*/
public long skip(long lLength)
throws IOException
{
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
stream.skip(lLength);
}
return lLength;
}
/**
The minimum of available() of all input stream is calculated and returned.
*/
public int available()
throws IOException
{
int nAvailable = 0;
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
nAvailable = Math.min(nAvailable, stream.available());
}
return nAvailable;
}
public void close()
throws IOException
{
// TODO: should we close all streams in the list?
}
/**
Calls mark() on all input streams.
*/
public void mark(int nReadLimit)
{
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
stream.mark(nReadLimit);
}
}
/**
Calls reset() on all input streams.
*/
public void reset()
throws IOException
{
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
stream.reset();
}
}
/**
returns true if all input stream return true for markSupported().
*/
public boolean markSupported()
{
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
if (! stream.markSupported())
{
return false;
}
}
return true;
}
private static void out(String strMessage)
{
System.out.println(strMessage);
}
}
package ai.qiwu.com.tts_service.common.sound;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import java.io.File;
import java.io.IOException;
/**
* @dateTime 19-11-23 下午3:52
*/
public class Mp3Encoder {
private static boolean DEBUG = false;
private static boolean dumpExceptions=false;
private static boolean traceConverters=false;
private static boolean quiet=false;
private static final AudioFormat.Encoding MPEG1L3 = new AudioFormat.Encoding("MPEG1L3");
private static final AudioFileFormat.Type MP3 = new AudioFileFormat.Type("MP3", "mp3");
private static AudioInputStream getInStream(String filename)
throws IOException {
File file = new File(filename);
AudioInputStream ais = null;
try {
ais = AudioSystem.getAudioInputStream(file);
} catch (Exception e) {
if (dumpExceptions) {
e.printStackTrace();
} else if (!quiet) {
System.out.println("Error: " + e.getMessage());
}
}
if (ais == null) {
throw new IOException("Cannot open \"" + filename + "\"");
}
return ais;
}
public static String stripExtension(String filename) {
int ind = filename.lastIndexOf(".");
if (ind == -1
|| ind == filename.length()
|| filename.lastIndexOf(File.separator) > ind) {
// when dot is at last position,
// or a slash is after the dot, there isn't an extension
return filename;
}
return filename.substring(0, ind);
}
/* first version. Remains here for documentation how to
* get a stream with complete description of the target format.
*/
public static AudioInputStream getConvertedStream2(
AudioInputStream sourceStream,
AudioFormat.Encoding targetEncoding)
throws Exception {
AudioFormat sourceFormat = sourceStream.getFormat();
if (!quiet) {
System.out.println("Input format: " + sourceFormat);
}
// build the output format
AudioFormat targetFormat = new AudioFormat(
targetEncoding,
sourceFormat.getSampleRate(),
AudioSystem.NOT_SPECIFIED,
sourceFormat.getChannels(),
AudioSystem.NOT_SPECIFIED,
AudioSystem.NOT_SPECIFIED,
false); // endianness doesn't matter
// construct a converted stream
AudioInputStream targetStream = null;
if (!AudioSystem.isConversionSupported(targetFormat, sourceFormat)) {
if (DEBUG && !quiet) {
System.out.println("Direct conversion not possible.");
System.out.println("Trying with intermediate PCM format.");
}
AudioFormat intermediateFormat = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED,
sourceFormat.getSampleRate(),
16,
sourceFormat.getChannels(),
2 * sourceFormat.getChannels(), // frameSize
sourceFormat.getSampleRate(),
false);
if (AudioSystem.isConversionSupported(intermediateFormat, sourceFormat)) {
// intermediate conversion is supported
sourceStream = AudioSystem.getAudioInputStream(intermediateFormat, sourceStream);
}
}
targetStream = AudioSystem.getAudioInputStream(targetFormat, sourceStream);
if (targetStream == null) {
throw new Exception("conversion not supported");
}
if (!quiet) {
if (DEBUG) {
System.out.println("Got converted AudioInputStream: " + targetStream.getClass().getName());
}
System.out.println("Output format: " + targetStream.getFormat());
}
return targetStream;
}
public static AudioInputStream getConvertedStream(
AudioInputStream sourceStream,
AudioFormat.Encoding targetEncoding)
throws Exception {
AudioFormat sourceFormat = sourceStream.getFormat();
if (!quiet) {
System.out.println("Input format: " + sourceFormat);
}
// construct a converted stream
AudioInputStream targetStream = null;
if (!AudioSystem.isConversionSupported(targetEncoding, sourceFormat)) {
if (DEBUG && !quiet) {
System.out.println("Direct conversion not possible.");
System.out.println("Trying with intermediate PCM format.");
}
AudioFormat intermediateFormat = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED,
sourceFormat.getSampleRate(),
16,
sourceFormat.getChannels(),
2 * sourceFormat.getChannels(), // frameSize
sourceFormat.getSampleRate(),
false);
if (AudioSystem.isConversionSupported(intermediateFormat, sourceFormat)) {
// intermediate conversion is supported
sourceStream = AudioSystem.getAudioInputStream(intermediateFormat, sourceStream);
}
}
targetStream = AudioSystem.getAudioInputStream(targetEncoding, sourceStream);
if (targetStream == null) {
throw new Exception("conversion not supported");
}
if (!quiet) {
if (DEBUG) {
System.out.println("Got converted AudioInputStream: " + targetStream.getClass().getName());
}
System.out.println("Output format: " + targetStream.getFormat());
}
return targetStream;
}
public static int writeFile(String inFilename) {
int writtenBytes = -1;
try {
AudioFileFormat.Type targetType = MP3;
AudioInputStream ais = getInStream(inFilename);
ais = getConvertedStream(ais, MPEG1L3);
// construct the target filename
String outFilename = stripExtension(inFilename) + "." + targetType.getExtension();
// write the file
if (!quiet) {
System.out.println("Writing " + outFilename + "...");
}
writtenBytes = AudioSystem.write(ais, targetType, new File(outFilename));
if (DEBUG && !quiet) {
System.out.println("Effective parameters of output file:");
try {
String version=System.getProperty("tritonus.lame.encoder.version", "");
if (version!="") {
System.out.println(" Version = "+version);
}
System.out.println(" Quality = "+System.getProperty
("tritonus.lame.effective.quality", "<none>"));
System.out.println(" Bitrate = "+System.getProperty
("tritonus.lame.effective.bitrate", "<none>"));
System.out.println(" Channel Mode = "+System.getProperty
("tritonus.lame.effective.chmode", "<none>"));
System.out.println(" VBR mode = "+System.getProperty
("tritonus.lame.effective.vbr", "<none>"));
System.out.println(" Sample rate = "+System.getProperty
("tritonus.lame.effective.samplerate", "<none>"));
System.out.println(" Encoding = "+System.getProperty
("tritonus.lame.effective.encoding", "<none>"));
} catch (Throwable t1) {}
}
} catch (Throwable t) {
if (dumpExceptions) {
t.printStackTrace();
} else if (!quiet) {
System.out.println("Error: " + t.getMessage());
}
}
return writtenBytes;
}
// returns the first index in args where the files start
public static int parseArgs(String[] args) {
if (args.length == 0) {
usage();
}
// parse options
try {
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (arg.equals("--help")) {
usage();
}
if (arg.length() > 3 || arg.length() < 2 || !arg.startsWith("-")) {
return i;
}
char cArg = arg.charAt(1);
// options without parameter
if (cArg == 'v') {
DEBUG=true;
continue;
} else if (cArg == 'e') {
dumpExceptions=true;
continue;
} else if (cArg == 't') {
// org.tritonus.share.TDebug.TraceAudioConverter=true;
continue;
} else if (cArg == 's') {
quiet=true;
continue;
} else if (cArg == 'V') {
try {
System.setProperty("tritonus.lame.vbr", "true");
} catch (Throwable t1) {}
continue;
} else if (cArg == 'h') {
usage();
}
// options with parameter
if (args.length < i + 2) {
throw new Exception("Missing parameter or unrecognized option "+arg+".");
}
String param = args[i + 1];
i++;
switch (cArg) {
case 'q':
try {
System.setProperty("tritonus.lame.quality", param);
} catch (Throwable t2) {}
break;
case 'b':
try {
System.setProperty("tritonus.lame.bitrate", param);
} catch (Throwable t3) {}
break;
default:
throw new Exception("Unrecognized option "+arg+".");
}
}
throw new Exception("No input file(s) are given.");
} catch (Exception e) {
System.err.println(e.getMessage());
System.exit(1);
}
return 0; // statement not reached
}
public static void main(String[] args) {
//try {
// System.out.println("Librarypath=" + System.getProperty("java.library.path", ""));
//} catch (Throwable t) {}
int firstFileIndex = parseArgs(args);
int inputFiles = 0;
int success = 0;
long totalTime = System.currentTimeMillis();
for (int i = firstFileIndex; i < args.length; i++) {
long time = System.currentTimeMillis();
int bytes = writeFile(args[i]);
time = System.currentTimeMillis()-time;
inputFiles++;
if (bytes >= 0) {
if (bytes > 0) {
success++;
}
if (!quiet) {
System.out.println("Wrote " + bytes + " bytes in "
+ (time / 60000) + "m " + ((time/1000) % 60) + "s "
+ (time % 1000) + "ms ("
+ (time/1000) + "s).");
}
}
}
totalTime = System.currentTimeMillis() - totalTime;
if ((DEBUG && quiet) || !quiet) {
// this IS displayed in silent DEBUG mode
System.out.println("From " + inputFiles + " input file" + (inputFiles == 1 ? "" : "s") + ", "
+ success + " file" + (success == 1 ? " was" : "s were") + " converted successfully in "
+ (totalTime / 60000) + "m " + ((totalTime/1000) % 60) + "s ("
+ (totalTime/1000) + "s).");
}
System.exit(0);
}
/** Display a message of how to call this program.
*/
public static void usage() {
System.out.println("Mp3Encoder - convert audio files to mp3 (layer III of MPEG 1, MPEG 2 or MPEG 2.5");
System.out.println("java Mp3Encoder <options> <source file> [<source file>...]");
System.out.println("The output file(s) will be named like the source file(s) but");
System.out.println("with mp3 file extension.");
System.out.println("");
System.out.println("You need LAME 3.88 or later. Get it from http://sourceforge.net/projects/lame/");
System.out.println("");
System.out.println("<options> may be a combination of the following:");
System.out.println("-q <quality> Quality of output mp3 file. In VBR mode, this affects");
System.out.println(" the size of the mp3 file. (Default middle)");
System.out.println(" One of: lowest, low, middle, high, highest");
System.out.println("-b <bitrate> Bitrate in KBit/s. Useless in VBR mode. (Default 128)");
System.out.println(" One of: 32 40 48 56 64 80 96 112 128 160 192 224 256 320 (MPEG1)");
System.out.println(" Or: 8 16 24 32 40 48 56 64 80 96 112 128 144 160 (MPEG2 and MPEG2.5");
System.out.println("-V VBR (variable bit rate) mode. Slower, but potentially better");
System.out.println(" quality. (Default off)");
System.out.println("-v Be verbose.");
System.out.println("-s Be silent.");
System.out.println("-e Debugging: Dump stack trace of exceptions.");
System.out.println("-t Debugging: trace execution of converters.");
System.out.println("-h | --help Show this message.");
System.exit(1);
}
}
package ai.qiwu.com.tts_service.common.sound;
import ai.qiwu.com.tts_service.common.CallPython;
import ai.qiwu.com.tts_service.service.TTService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jaudiotagger.audio.exceptions.InvalidAudioFrameException;
import org.jaudiotagger.audio.exceptions.ReadOnlyFileException;
import org.jaudiotagger.audio.mp3.MP3AudioHeader;
import org.jaudiotagger.audio.mp3.MP3File;
import org.jaudiotagger.tag.TagException;
import ws.schild.jave.*;
import javax.sound.sampled.*;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* @dateTime 19-11-23 下午3:40
*/
@Slf4j
public class SampleRateConverter {
/** Flag for debugging messages.
* If true, some messages are dumped to the console
* during operation.
*/
private static boolean DEBUG = false;
public static final String SUFFIX = "TEMP";
public static final String SUFFIX_WAV = "TEMP.wav";
public static final String SUFFIX_MP3 = "TEMP.mp3";
private static final String WAV_SUFFIX = ".wav";
public static List<String> equalSampleRate(Collection<String> pathList) throws IOException, UnsupportedAudioFileException, InvalidAudioFrameException, TagException, ReadOnlyFileException {
float mouldSampleRate = 0;
List<String> changedRateList = new ArrayList<>();
boolean first = true;
for (String path: pathList) {
if (first) {
File file = new File(path);
mouldSampleRate = getMp3FileSampleRate(file);
// log.warn("root采样率{}",mouldSampleRate);
changedRateList.add(path);
first = false;
continue;
}
float num = getMp3FileSampleRate(new File(path));
// log.warn("{}:采样率:{}", path, num);
if (mouldSampleRate != num) {
// log.warn("{} different",path);
int spot = path.lastIndexOf(".");
String prefix = path.substring(0, spot);
path = prefix+WAV_SUFFIX;
if (!new File(path).exists()) {
log.error("{}不存在",path);
return null;
}
String tempMp3Path = changeSampleRate(new File(path), prefix, mouldSampleRate);
if (StringUtils.isBlank(tempMp3Path)) return null;
changedRateList.add(tempMp3Path);
} else {
changedRateList.add(path);
}
}
return changedRateList;
}
public static List<String> equalWavData(Collection<String> pathList) throws IOException, UnsupportedAudioFileException, InvalidAudioFrameException, TagException, ReadOnlyFileException {
int mouldSampleRate = 0;
int channel = 1;
List<String> changedRateList = new ArrayList<>();
boolean first = true;
for (String path: pathList) {
if (first) {
File file = new File(path);
mouldSampleRate = getMp3FileSampleRate(file);
channel = getMp3FileChannel(file);
// log.warn("root采样率{}",mouldSampleRate);
changedRateList.add(path);
first = false;
continue;
}
// log.warn("{}:采样率:{}", path, num);
if (mouldSampleRate != getMp3FileSampleRate(new File(path))) {
// log.warn("{} different",path);
int spot = path.lastIndexOf(".");
String prefix = path.substring(0, spot);
path = prefix+WAV_SUFFIX;
String targetWavPath = prefix+SUFFIX_WAV;
if (!new File(path).exists()) {
log.error("{}不存在",path);
return null;
}
AudioConverter.changeWavData(new File(path), targetWavPath, mouldSampleRate, channel);
String tempMp3Path = CallPython.wav2Mp3(targetWavPath, prefix+SUFFIX_MP3);
if (tempMp3Path == null) return null;
changedRateList.add(tempMp3Path);
} else {
changedRateList.add(path);
}
}
return changedRateList;
}
public static List<String> equalSampleRateUseFfmepg(Collection<String> pathList) throws EncoderException {
int mouldSampleRate = 0;
int channel = 1;
// long bitRate = 0;
List<String> changedRateList = new ArrayList<>();
boolean first = true;
int i = -1;
List<Future> futureList = new ArrayList<>();
for (String path: pathList) {
i++;
final MultimediaObject sourceObject = new MultimediaObject(new File(path));
final AudioInfo audioInfo = sourceObject.getInfo().getAudio();
if (first) {
mouldSampleRate = audioInfo.getSamplingRate();
channel = audioInfo.getChannels();
changedRateList.add(path);
first = false;
continue;
}
if (mouldSampleRate != audioInfo.getSamplingRate()) {
// log.warn("{} different",path);
final Integer index = i;
final Integer sr = mouldSampleRate;
final Integer cl = channel;
Future future = TTService.POOL.submit(() -> {
try {
String tempMp3Path = path.substring(0, path.lastIndexOf("."))+SUFFIX_MP3;
ffmepg(sourceObject, audioInfo, tempMp3Path, sr,cl);
changedRateList.add(index,tempMp3Path);
} catch (Exception e) {
throw new RuntimeException(e);
}
});
futureList.add(future);
} else {
changedRateList.add(i, path);
}
}
for (Future future: futureList) {
try {
future.get(6, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
log.error("ffmpeg error:{}", ExceptionUtils.getStackTrace(e));
return null;
}
}
return changedRateList;
}
private static void ffmepg(MultimediaObject sourceObject,AudioInfo audioInfo,String target, int sampleRate, int channel) throws EncoderException {
AudioAttributes audio = new AudioAttributes();
audio.setCodec("libmp3lame");
audio.setBitRate(audioInfo.getBitRate());
audio.setChannels(channel);
audio.setSamplingRate(sampleRate);
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("mp3");
attrs.setAudioAttributes(audio);
Encoder encoder = new Encoder();
encoder.encode(sourceObject, new File(target), attrs);
}
private static int getMp3FileSampleRate(File file) throws ReadOnlyFileException, TagException, InvalidAudioFrameException, IOException {
MP3File mp3File = new MP3File(file);
return mp3File.getMP3AudioHeader().getSampleRateAsNumber();
}
private static int getMp3FileChannel(File file) throws ReadOnlyFileException, TagException, InvalidAudioFrameException, IOException {
MP3File mp3File = new MP3File(file);
String mode = mp3File.getMP3AudioHeader().getChannels();
if (StringUtils.containsIgnoreCase(mode, "Stereo")) return 2;
return 1;
}
private static String changeSampleRate(File sourceFile, String targetPath, float fTargetSampleRate) throws IOException, UnsupportedAudioFileException {
AudioFileFormat sourceFileFormat = AudioSystem.getAudioFileFormat(sourceFile);
AudioFileFormat.Type targetFileType = sourceFileFormat.getType();
AudioInputStream sourceStream;
sourceStream = AudioSystem.getAudioInputStream(sourceFile);
if (sourceStream == null)
{
out("cannot open source audio file: " + sourceFile);
System.exit(1);
}
AudioFormat sourceFormat = sourceStream.getFormat();
if (DEBUG) { out("source format: " + sourceFormat); }
AudioFormat.Encoding encoding = sourceFormat.getEncoding();
if (! AudioCommon.isPcm(encoding))
{
out("encoding of source audio data is not PCM; conversion not possible");
System.exit(1);
}
float fTargetFrameRate = fTargetSampleRate;
AudioFormat targetFormat = new AudioFormat(
sourceFormat.getEncoding(),
fTargetSampleRate,
sourceFormat.getSampleSizeInBits(),
sourceFormat.getChannels(),
sourceFormat.getFrameSize(),
fTargetSampleRate,
sourceFormat.isBigEndian());
if (DEBUG) { out("desired target format: " + targetFormat); }
AudioInputStream targetStream = AudioSystem.getAudioInputStream(targetFormat, sourceStream);
if (DEBUG) { out("targetStream: " + targetStream); }
int nWrittenBytes;
String wavTargetPath = targetPath+SUFFIX_WAV;
nWrittenBytes = AudioSystem.write(targetStream, targetFileType, new File(wavTargetPath));
if (DEBUG) { out("Written bytes: " + nWrittenBytes); }
// try {
// log.warn("{}改变后的采样率:{}",wavTargetPath, AudioSystem.getAudioInputStream(new File(wavTargetPath)).getFormat().getSampleRate());
// } catch (Exception e) {
// log.warn("what fuck:{}",e);
// }
return CallPython.wav2Mp3(wavTargetPath, targetPath+SUFFIX_MP3);
}
public static void main(String[] args)
throws UnsupportedAudioFileException, IOException
{
// if (args.length == 1)
// {
// if (args[0].equals("-h"))
// {
// printUsageAndExit();
// }
// else
// {
// printUsageAndExit();
// }
// }
// else if (args.length != 3)
// {
// printUsageAndExit();
// }
// float fTargetSampleRate = Float.parseFloat(args[0]);
// if (DEBUG) { out("target sample rate: " + fTargetSampleRate); }
// File sourceFile = new File(args[1]);
// File targetFile = new File(args[2]);
float fTargetSampleRate = Float.parseFloat("48000");
File sourceFile = new File("/home/yf01/下载/us1.wav");
File targetFile = new File("/home/yf01/下载/us1change.wav");
/* We try to use the same audio file type for the target
file as the source file. So we first have to find
out about the source file's properties.
*/
AudioFileFormat sourceFileFormat = AudioSystem.getAudioFileFormat(sourceFile);
AudioFileFormat.Type targetFileType = sourceFileFormat.getType();
/* Here, we are reading the source file.
*/
AudioInputStream sourceStream = null;
sourceStream = AudioSystem.getAudioInputStream(sourceFile);
if (sourceStream == null)
{
out("cannot open source audio file: " + sourceFile);
System.exit(1);
}
AudioFormat sourceFormat = sourceStream.getFormat();
if (DEBUG) { out("source format: " + sourceFormat); }
/* Currently, the only known and working sample rate
converter for Java Sound requires that the encoding
of the source stream is PCM (signed or unsigned).
So as a measure of convenience, we check if this
holds here.
*/
AudioFormat.Encoding encoding = sourceFormat.getEncoding();
if (! AudioCommon.isPcm(encoding))
{
out("encoding of source audio data is not PCM; conversion not possible");
System.exit(1);
}
/* Since we now know that we are dealing with PCM, we know
that the frame rate is the same as the sample rate.
*/
/* Here, we are constructing the desired format of the
audio data (as the result of the conversion should be).
We take over all values besides the sample/frame rate.
*/
AudioFormat targetFormat = new AudioFormat(
sourceFormat.getEncoding(),
fTargetSampleRate,
sourceFormat.getSampleSizeInBits(),
sourceFormat.getChannels(),
sourceFormat.getFrameSize(),
fTargetSampleRate,
sourceFormat.isBigEndian());
if (DEBUG) { out("desired target format: " + targetFormat); }
/* Now, the conversion takes place.
*/
AudioInputStream targetStream = AudioSystem.getAudioInputStream(targetFormat, sourceStream);
if (DEBUG) { out("targetStream: " + targetStream); }
/* And finally, we are trying to write the converted audio
data to a new file.
*/
int nWrittenBytes = 0;
nWrittenBytes = AudioSystem.write(targetStream, targetFileType, targetFile);
if (DEBUG) { out("Written bytes: " + nWrittenBytes); }
}
private static void printUsageAndExit()
{
out("SampleRateConverter: usage:");
out("\tjava SampleRateConverter -h");
out("\tjava SampleRateConverter <targetsamplerate> <sourcefile> <targetfile>");
System.exit(1);
}
private static void out(String strMessage)
{
System.out.println(strMessage);
}
}
package ai.qiwu.com.tts_service.common.sound;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
/**
* @dateTime 19-11-25 下午3:06
*/
public class SequenceAudioInputStream extends AudioInputStream {
private static final boolean DEBUG = true;
private List m_audioInputStreamList;
private int m_nCurrentStream;
public SequenceAudioInputStream(AudioFormat audioFormat, Collection audioInputStreams)
{
super(new ByteArrayInputStream(new byte[0]), audioFormat, AudioSystem.NOT_SPECIFIED);
m_audioInputStreamList = new ArrayList(audioInputStreams);
m_nCurrentStream = 0;
}
// TODO: remove
private boolean addAudioInputStream(AudioInputStream audioStream)
{
if (DEBUG)
{
out("SequenceAudioInputStream.addAudioInputStream(): called.");
}
// Contract.check(audioStream != null);
if (!getFormat().matches(audioStream.getFormat()))
{
if (DEBUG)
{
out("SequenceAudioInputStream.addAudioInputStream(): audio formats do not match, trying to convert.");
}
AudioInputStream asold = audioStream;
audioStream = AudioSystem.getAudioInputStream(getFormat(), asold);
if (audioStream == null)
{
out("### SequenceAudioInputStream.addAudioInputStream(): could not convert.");
return false;
}
if (DEBUG)
{
out(" converted");
}
}
// Contract.check(audioStream != null);
synchronized (m_audioInputStreamList)
{
m_audioInputStreamList.add(audioStream);
m_audioInputStreamList.notifyAll();
}
if (DEBUG)
{
out("SequenceAudioInputStream.addAudioInputStream(): enqueued " + audioStream);
}
return true;
}
private AudioInputStream getCurrentStream()
{
return (AudioInputStream) m_audioInputStreamList.get(m_nCurrentStream);
}
private boolean advanceStream()
{
m_nCurrentStream++;
boolean bAnotherStreamAvailable = (m_nCurrentStream < m_audioInputStreamList.size());
return bAnotherStreamAvailable;
}
public long getFrameLength()
{
long lLengthInFrames = 0;
Iterator streamIterator = m_audioInputStreamList.iterator();
while (streamIterator.hasNext())
{
AudioInputStream stream = (AudioInputStream) streamIterator.next();
long lLength = stream.getFrameLength();
if (lLength == AudioSystem.NOT_SPECIFIED)
{
return AudioSystem.NOT_SPECIFIED;
}
else
{
lLengthInFrames += lLength;
}
}
return lLengthInFrames;
}
public int read()
throws IOException
{
AudioInputStream stream = getCurrentStream();
int nByte = stream.read();
if (nByte == -1)
{
/*
The end of the current stream has been signaled.
We try to advance to the next stream.
*/
boolean bAnotherStreamAvailable = advanceStream();
if (bAnotherStreamAvailable)
{
/*
There is another stream. We recurse into this method
to read from it.
*/
return read();
}
else
{
/*
No more data. We signal EOF.
*/
return -1;
}
}
else
{
/*
The most common case: We return the byte.
*/
return nByte;
}
}
public int read(byte[] abData, int nOffset, int nLength)
throws IOException
{
AudioInputStream stream = getCurrentStream();
int nBytesRead = stream.read(abData, nOffset, nLength);
if (nBytesRead == -1)
{
/*
The end of the current stream has been signaled.
We try to advance to the next stream.
*/
boolean bAnotherStreamAvailable = advanceStream();
if (bAnotherStreamAvailable)
{
/*
There is another stream. We recurse into this method
to read from it.
*/
return read(abData, nOffset, nLength);
}
else
{
/*
No more data. We signal EOF.
*/
return -1;
}
}
else
{
/*
The most common case: We return the length.
*/
return nBytesRead;
}
}
public long skip(long lLength)
throws IOException
{
throw new IOException("skip() is not implemented in class SequenceInputStream. Mail if you need this feature.");
}
public int available()
throws IOException
{
return getCurrentStream().available();
}
public void close()
throws IOException
{
// TODO: should we close all streams in the list?
}
public void mark(int nReadLimit)
{
throw new RuntimeException("mark() is not implemented in class SequenceInputStream. Mail if you need this feature.");
}
public void reset()
throws IOException
{
throw new IOException("reset() is not implemented in class SequenceInputStream. Mail if you need this feature.");
}
public boolean markSupported()
{
return false;
}
private static void out(String strMessage)
{
System.out.println(strMessage);
}
}
...@@ -23,5 +23,6 @@ public class TextInfo { ...@@ -23,5 +23,6 @@ public class TextInfo {
private Boolean cache; private Boolean cache;
private String server; private String server;
private String botname; private String botname;
private String botAccount;
private String npcName; private String npcName;
} }
...@@ -47,7 +47,7 @@ public class TTService { ...@@ -47,7 +47,7 @@ public class TTService {
/** /**
* 线程池,核心线程数cpu数目的两倍,非核心线程存活时间为3s * 线程池,核心线程数cpu数目的两倍,非核心线程存活时间为3s
*/ */
private static final ThreadPoolExecutor POOL = new ThreadPoolExecutor(CORE_THREAD_NUM*2, public static final ThreadPoolExecutor POOL = new ThreadPoolExecutor(CORE_THREAD_NUM*2,
1500, 3, TimeUnit.SECONDS, new ArrayBlockingQueue<>(15), 1500, 3, TimeUnit.SECONDS, new ArrayBlockingQueue<>(15),
new ThreadPoolExecutor.CallerRunsPolicy()); new ThreadPoolExecutor.CallerRunsPolicy());
...@@ -241,13 +241,23 @@ public class TTService { ...@@ -241,13 +241,23 @@ public class TTService {
} }
List<Future<ResponseCodeWithData>> futures = new ArrayList<>(); List<Future<ResponseCodeWithData>> futures = new ArrayList<>();
List<String> file_ls = new ArrayList<>(); List<String> file_ls = new ArrayList<>();
String rootFolder = new StringBuilder(Initialize.getAudioDir()).append(File.separator).append(botName).append(File.separator).toString(); String rootFolderRoot = new StringBuilder(Initialize.getAudioDir()).append(File.separator).append(botName).append(File.separator).toString();
String uploadFolder = new StringBuilder(rootFolder).append(Initialize.getUploadedDir()).append(File.separator).toString(); String uploadFolderRoot = new StringBuilder(rootFolderRoot).append(Initialize.getUploadedDir()).append(File.separator).toString();
//String combineFolder = new StringBuilder(rootFolder).append("combine").append(File.separator).toString(); //String combineFolder = new StringBuilder(rootFolder).append("combine").append(File.separator).toString();
// 第三方语音是否生成,为0则代表不处理该第三方语音 // 第三方语音是否生成,为0则代表不处理该第三方语音
boolean geneThird = request.getGen3rd() == null || request.getGen3rd() != 0; boolean geneThird = request.getGen3rd() == null || request.getGen3rd() != 0;
if (infoList != null && infoList.size() != 0) { if (infoList != null && infoList.size() != 0) {
for (TextInfo info : infoList) { for (TextInfo info : infoList) {
String uploadFolder, rootFolder;
if (botName.equals(info.getBotAccount()) || StringUtils.isBlank(info.getBotAccount())) {
rootFolder = rootFolderRoot;
uploadFolder = uploadFolderRoot;
} else {
rootFolder = new StringBuilder(Initialize.getAudioDir()).append(File.separator)
.append(info.getBotAccount()).append(File.separator).toString();
uploadFolder = new StringBuilder(rootFolder).append(Initialize.getUploadedDir()).append(File.separator).toString();
}
// person没有值或是不存在则赋予init_person // person没有值或是不存在则赋予init_person
String person = info.getPerson(); String person = info.getPerson();
if (StringUtils.isBlank(person)) person = initialize.getInit_person(); if (StringUtils.isBlank(person)) person = initialize.getInit_person();
...@@ -415,8 +425,8 @@ public class TTService { ...@@ -415,8 +425,8 @@ public class TTService {
tmp_name),200), null, 200); tmp_name),200), null, 200);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("调用python的combine出错:{}", e.toString()); log.error("合成多个音频文件出错:{}", e.toString());
TTServiceUtil.buildTTS_lsResponse(response, new TTSResponse(555, "调用python的combine出错"+e.toString()), null, 555); TTServiceUtil.buildTTS_lsResponse(response, new TTSResponse(555, "合成多个音频文件出错"), null, 500);
} }
} }
// 非xiaoai平台的请求,首先将.mp3文件的数据存储在对应的.mp3.b64文件内 // 非xiaoai平台的请求,首先将.mp3文件的数据存储在对应的.mp3.b64文件内
......
package ai.qiwu.com.tts_service.service; package ai.qiwu.com.tts_service.service;
import ai.qiwu.com.tts_service.common.TTSUtils; import ai.qiwu.com.tts_service.common.TTSUtils;
import ai.qiwu.com.tts_service.common.sound.SampleRateConverter;
import ai.qiwu.com.tts_service.pojo.TtsLsAudio; import ai.qiwu.com.tts_service.pojo.TtsLsAudio;
import ai.qiwu.com.tts_service.pojo.TtsLsResponse; import ai.qiwu.com.tts_service.pojo.TtsLsResponse;
import ai.qiwu.com.tts_service.pojo.TtsLsType; import ai.qiwu.com.tts_service.pojo.TtsLsType;
...@@ -10,8 +11,16 @@ import com.csvreader.CsvReader; ...@@ -10,8 +11,16 @@ import com.csvreader.CsvReader;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jaudiotagger.audio.exceptions.InvalidAudioFrameException;
import org.jaudiotagger.audio.exceptions.ReadOnlyFileException;
import org.jaudiotagger.audio.mp3.MP3File;
import org.jaudiotagger.tag.TagException;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;
import java.io.*; import java.io.*;
import java.math.BigInteger; import java.math.BigInteger;
import java.net.URLDecoder; import java.net.URLDecoder;
...@@ -21,6 +30,8 @@ import java.nio.file.Files; ...@@ -21,6 +30,8 @@ import java.nio.file.Files;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -253,16 +264,31 @@ public class Test { ...@@ -253,16 +264,31 @@ public class Test {
return "3"; return "3";
} }
public static void main(String[] args) throws IOException, ParseException { private static void convert(File input, File outPut) throws IOException, UnsupportedAudioFileException {
AudioInputStream stream = AudioSystem.getAudioInputStream(input);
AudioFormat format = stream.getFormat();
}
public static void main(String[] args) throws IOException, ParseException, UnsupportedAudioFileException, InvalidAudioFrameException, TagException, ReadOnlyFileException {
Pattern pattern = Pattern.compile(TTSUtils.getAbRegex()); Pattern pattern = Pattern.compile(TTSUtils.getAbRegex());
String[] arrr = pattern.split("回答错误,正确答案为 :风吹草地见牛羊。 当前体力值为 \uD83C\uDD7097\uD83C\uDD71"); String[] arrr = pattern.split("回答错误,正确答案为 :风吹草地见牛羊。 当前体力值为 \uD83C\uDD7097\uD83C\uDD71");
System.out.println(Arrays.toString(arrr)); System.out.println(Arrays.toString(arrr));
Date date = new Date(1572522571234L); Date date = new Date(1572522571234L);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(TTSUtils.buildMP3Filename("回答错误,正确答案为 :黄河入海流。 当前体力值为")); System.out.println(format.format(new Date()));
System.out.println(TTSUtils.buildMP3Filename("98")); ArrayList<String> list = new ArrayList<>();
System.out.println(TTSUtils.buildMP3Filename("回答错误,正确答案为 :疑是地上霜。 当前体力值为 ")); list.add("/home/yf01/下载/human1.mp3");
list.add("/home/yf01/下载/human2.mp3");
list.add("/home/yf01/下载/us1.mp3");
list.add("/home/yf01/下载/us2.mp3");
// TTSUtils.combineMp3File(list, "/home/yf01/下载/targetss.mp3");
try {
File[] files = new File("/home/yf01/下载/tts").listFiles((dir, name) -> !name.equals("test"));
for (File file: files) System.out.println(file.getName());
System.out.println(files.length);
} catch (Exception e){}
} }
} }
...@@ -45,6 +45,16 @@ public class XiaoDuHomeController { ...@@ -45,6 +45,16 @@ public class XiaoDuHomeController {
// return xiaoAiService.getResponse(request); // return xiaoAiService.getResponse(request);
} }
@RequestMapping("/xiaoai/child")
public XiaoAiResponse xiaoaiChild(@RequestBody XiaoAiRequest request) {
//log.info("请求:"+request);
request.setType(1);
XiaoAiResponse response = xiaoAiService.getResponse(request);
// log.info("响应:"+response);
return response;
// return xiaoAiService.getResponse(request);
}
@RequestMapping("/xiaoduhome/chat") @RequestMapping("/xiaoduhome/chat")
public String chat() { public String chat() {
try { try {
......
...@@ -6,6 +6,7 @@ import ai.qiwu.com.xiaoduhome.xiaoai.model.QiWuResponse; ...@@ -6,6 +6,7 @@ import ai.qiwu.com.xiaoduhome.xiaoai.model.QiWuResponse;
import ai.qiwu.com.xiaoduhome.xiaoai.service.XiaoAiService; import ai.qiwu.com.xiaoduhome.xiaoai.service.XiaoAiService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.math.NumberUtils;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
...@@ -24,7 +25,7 @@ public class RequestTerminal { ...@@ -24,7 +25,7 @@ public class RequestTerminal {
* @return mp3链接及文字描述 * @return mp3链接及文字描述
* @throws IOException * @throws IOException
*/ */
public static QiWuResponse requestTerminate(String userId, String userWord) throws IOException { public static QiWuResponse requestTerminate(String userId, String userWord, Integer type) throws IOException {
QiWuRequest requestPojo = new QiWuRequest(); QiWuRequest requestPojo = new QiWuRequest();
requestPojo.setUid(userId); requestPojo.setUid(userId);
// requestPojo.setAccess(XiaoAiConstants.DEVICE_NAME); // requestPojo.setAccess(XiaoAiConstants.DEVICE_NAME);
...@@ -33,7 +34,8 @@ public class RequestTerminal { ...@@ -33,7 +34,8 @@ public class RequestTerminal {
//log.info("向终端发出请求的参数信息:{}", requestJsonStr); //log.info("向终端发出请求的参数信息:{}", requestJsonStr);
HashMap<String, String> headers = new HashMap<>(); HashMap<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/json;charset=utf-8"); headers.put("Content-Type", "application/json;charset=utf-8");
headers.put("App-Channel-Id", "jiaoyou-audio-test"); if (NumberUtils.INTEGER_ONE.equals(type)) headers.put("App-Channel-Id", "jiaoyou-audio-child-test");
else headers.put("App-Channel-Id", "jiaoyou-audio-test");
String resStr; String resStr;
if (userId.equals(XiaoAiService.deviceId)) { if (userId.equals(XiaoAiService.deviceId)) {
resStr = OkHttp3Utils.doPostJsonStr(XiaoAiConstants.QI_WU_TERMINATE_DIDI, requestJsonStr, headers); resStr = OkHttp3Utils.doPostJsonStr(XiaoAiConstants.QI_WU_TERMINATE_DIDI, requestJsonStr, headers);
......
...@@ -22,7 +22,9 @@ public interface XiaoAiConstants { ...@@ -22,7 +22,9 @@ public interface XiaoAiConstants {
interface TTS { interface TTS {
String WELCOME_WORD = "欢迎来到交游天下,海量的作品在这等您"; String WELCOME_WORD = "欢迎来到交游天下,海量的作品在这等您";
String WELCOME_WORD_CHILD = "小朋友你好,欢迎来到智能故事";
String END_BYE = "我们的作品库在不断扩充,欢迎再来玩"; String END_BYE = "我们的作品库在不断扩充,欢迎再来玩";
String END_BYE_CHILD = "再见啦小朋友,记得下次再来玩哦";
String END_WORD = "退出"; String END_WORD = "退出";
String USER_IDLE = "小悟在等你的回复"; String USER_IDLE = "小悟在等你的回复";
String ANOTHER_USER_IDLE = "再不回复我,那我可退出喽"; String ANOTHER_USER_IDLE = "再不回复我,那我可退出喽";
......
...@@ -3,6 +3,7 @@ package ai.qiwu.com.xiaoduhome.xiaoai.model.request; ...@@ -3,6 +3,7 @@ package ai.qiwu.com.xiaoduhome.xiaoai.model.request;
import ai.qiwu.com.xiaoduhome.xiaoai.model.request.context.Context; import ai.qiwu.com.xiaoduhome.xiaoai.model.request.context.Context;
import ai.qiwu.com.xiaoduhome.xiaoai.model.request.innerRequest.Request; import ai.qiwu.com.xiaoduhome.xiaoai.model.request.innerRequest.Request;
import ai.qiwu.com.xiaoduhome.xiaoai.model.request.session.Session; import ai.qiwu.com.xiaoduhome.xiaoai.model.request.session.Session;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.ToString; import lombok.ToString;
...@@ -14,10 +15,13 @@ import lombok.ToString; ...@@ -14,10 +15,13 @@ import lombok.ToString;
@Getter @Getter
@Setter @Setter
@ToString @ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class XiaoAiRequest { public class XiaoAiRequest {
private String version; private String version;
private String query; private String query;
private Session session; private Session session;
private Context context; private Context context;
private Request request; private Request request;
private Integer type; // 1 为jiaoyou-audio-child-test
} }
...@@ -64,7 +64,7 @@ public class XiaoAiService { ...@@ -64,7 +64,7 @@ public class XiaoAiService {
switch (type) { switch (type) {
case 0 : return dealWithLaunchRequest(request); case 0 : return dealWithLaunchRequest(request);
case 1 : return dealWithIntentRequest(request, userId); case 1 : return dealWithIntentRequest(request, userId);
case 2 : return dealWithEndRequest(userId); case 2 : return dealWithEndRequest(userId, request.getType());
default: return buildTextResponse(SORRY_REPEAT); default: return buildTextResponse(SORRY_REPEAT);
} }
} }
...@@ -179,6 +179,7 @@ public class XiaoAiService { ...@@ -179,6 +179,7 @@ public class XiaoAiService {
// } // }
LAST_OUTTIME_RESULT.remove(getUserId(request)); LAST_OUTTIME_RESULT.remove(getUserId(request));
LAST_OUTTIME_MARK.remove(getUserId(request)); LAST_OUTTIME_MARK.remove(getUserId(request));
if (NumberUtils.INTEGER_ONE.equals(request.getType())) return buildTextResponse(XiaoAiConstants.TTS.WELCOME_WORD_CHILD);
return buildTextResponse(XiaoAiConstants.TTS.WELCOME_WORD); return buildTextResponse(XiaoAiConstants.TTS.WELCOME_WORD);
} }
...@@ -236,7 +237,7 @@ public class XiaoAiService { ...@@ -236,7 +237,7 @@ public class XiaoAiService {
// XiaoAiResponse response = getLastResult(userId); // XiaoAiResponse response = getLastResult(userId);
// if (response != null) return response; // if (response != null) return response;
try { try {
Future future = DplbotServiceUtil.getPool().submit(new Task(userId, request.getQuery())); Future future = DplbotServiceUtil.getPool().submit(new Task(userId, request.getQuery(), request.getType()));
future.get(2100, TimeUnit.MILLISECONDS); future.get(2100, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
log.error("获取任务执行结果出错:{}", e.toString()); log.error("获取任务执行结果出错:{}", e.toString());
...@@ -257,16 +258,17 @@ public class XiaoAiService { ...@@ -257,16 +258,17 @@ public class XiaoAiService {
* @param userId 用户id * @param userId 用户id
* @return 返回信息 * @return 返回信息
*/ */
private XiaoAiResponse dealWithEndRequest(String userId) { private XiaoAiResponse dealWithEndRequest(String userId, Integer type) {
DplbotServiceUtil.getPool().submit(() -> { DplbotServiceUtil.getPool().submit(() -> {
try { try {
RequestTerminal.requestTerminate(userId, XiaoAiConstants.TTS.END_WORD); RequestTerminal.requestTerminate(userId, XiaoAiConstants.TTS.END_WORD, type);
} catch (Exception e) { } catch (Exception e) {
log.error("向终端发出的退出请求失败:{}", e.toString()); log.error("向终端发出的退出请求失败:{}", e.toString());
} }
}); });
LAST_OUTTIME_MARK.remove(userId); LAST_OUTTIME_MARK.remove(userId);
LAST_OUTTIME_RESULT.remove(userId); LAST_OUTTIME_RESULT.remove(userId);
if (NumberUtils.INTEGER_ONE.equals(type)) return buildTextResponse(XiaoAiConstants.TTS.END_BYE_CHILD);
return buildTextResponse(XiaoAiConstants.TTS.END_BYE); return buildTextResponse(XiaoAiConstants.TTS.END_BYE);
} }
...@@ -294,12 +296,14 @@ public class XiaoAiService { ...@@ -294,12 +296,14 @@ public class XiaoAiService {
* 任务封装类 * 任务封装类
*/ */
class Task implements Runnable { class Task implements Runnable {
private String userId; private final String userId;
private String userWord; private final String userWord;
private final Integer type;
Task(String userId, String userWord) { Task(String userId, String userWord, Integer type) {
this.userId = userId; this.userId = userId;
this.userWord = userWord; this.userWord = userWord;
this.type = type;
} }
@Override @Override
...@@ -312,7 +316,7 @@ public class XiaoAiService { ...@@ -312,7 +316,7 @@ public class XiaoAiService {
log.info("小爱,用户说的话:{}", userWord); log.info("小爱,用户说的话:{}", userWord);
QiWuResponse response; QiWuResponse response;
try { try {
response = RequestTerminal.requestTerminate(userId, userWord); response = RequestTerminal.requestTerminate(userId, userWord, type);
} catch (Exception e) { } catch (Exception e) {
log.error("向终端发出的请求信息失败:{}", e.toString()); log.error("向终端发出的请求信息失败:{}", e.toString());
throw new RequestTerminateFail(e.toString()); throw new RequestTerminateFail(e.toString());
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<button type="button" class="layui-btn button " id="one">小度1号 (gz4)</button> <button type="button" class="layui-btn button " id="one">小度1号 (gz4)</button>
<button type="button" class="layui-btn button " id="four">小度2号 (gz3)</button> <button type="button" class="layui-btn button " id="four">小度2号 (gz3)</button>
<button type="button" class="layui-btn button " id="tow">小爱1号(gz3)</button> <button type="button" class="layui-btn button " id="tow">小爱1号(gz3)</button>
<button type="button" class="layui-btn button " id="therr">小爱2号(gz3)</button> <button type="button" class="layui-btn button " id="therr">小爱2号(gz4)</button>
</div> </div>
</body> </body>
<style> <style>
......
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