Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tts-client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周亚武
tts-client
Commits
8d5e9bb1
Commit
8d5e9bb1
authored
9 months ago
by
周亚武
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
语音合成规则修改
parent
646e6d81
master
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
17 deletions
+33
-17
pom.xml
pom.xml
+7
-0
src/main/java/com/mortals/xhx/tts/UI/MainWindow.java
src/main/java/com/mortals/xhx/tts/UI/MainWindow.java
+15
-15
src/main/java/com/mortals/xhx/tts/utils/SpliceMp3Util.java
src/main/java/com/mortals/xhx/tts/utils/SpliceMp3Util.java
+11
-2
No files found.
pom.xml
View file @
8d5e9bb1
...
@@ -161,6 +161,13 @@
...
@@ -161,6 +161,13 @@
<version>
${pcap4j.version}
</version>
<version>
${pcap4j.version}
</version>
</dependency>
</dependency>
<!--fileInputstream转file-->
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.11.0
</version>
</dependency>
<!--Zxing 条形码二维码生成和解析工具-->
<!--Zxing 条形码二维码生成和解析工具-->
<dependency>
<dependency>
<groupId>
com.google.zxing
</groupId>
<groupId>
com.google.zxing
</groupId>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/mortals/xhx/tts/UI/MainWindow.java
View file @
8d5e9bb1
...
@@ -321,19 +321,19 @@ public class MainWindow {
...
@@ -321,19 +321,19 @@ public class MainWindow {
//
while (true){
while
(
true
){
//
try {
try
{
//
Thread.sleep(2000);
Thread
.
sleep
(
2000
);
//
} catch (InterruptedException e) {
}
catch
(
InterruptedException
e
)
{
//
throw new RuntimeException(e);
throw
new
RuntimeException
(
e
);
//
}
}
//
//
FlowNumBean flowNumBean = new FlowNumBean(6, "A00"+(msgIndex%100), "010", "010", System.currentTimeMillis());
FlowNumBean
flowNumBean
=
new
FlowNumBean
(
6
,
"A00"
+(
msgIndex
%
100
),
"010"
,
"010"
,
System
.
currentTimeMillis
());
//
pushRabbitMsg("请"+flowNumBean.getFlownum()+"号到"+flowNumBean.getWindowfromnum()+"号窗口");
pushRabbitMsg
(
"请"
+
flowNumBean
.
getFlownum
()+
"号到"
+
flowNumBean
.
getWindowfromnum
()+
"号窗口"
);
//
test(flowNumBean);
test
(
flowNumBean
);
//
//
//
}
}
}
}
private
void
initMQ
(){
private
void
initMQ
(){
...
@@ -745,8 +745,8 @@ public class MainWindow {
...
@@ -745,8 +745,8 @@ public class MainWindow {
try
{
try
{
//语音拼接
//语音拼接
List
<
String
>
audioList
=
new
ArrayList
<>();
List
<
String
>
audioList
=
new
ArrayList
<>();
String
englishPeople
=
System
.
getProperty
(
"user.dir"
)+
"/src/main/resources/
sound/en/"
;
String
englishPeople
=
"
sound/en/"
;
String
zangPeople
=
System
.
getProperty
(
"user.dir"
)+
"/src/main/resources/
sound/zang/"
;
String
zangPeople
=
"
sound/zang/"
;
if
(
english
){
//英双语
if
(
english
){
//英双语
audioList
.
add
(
englishPeople
+
"qing.mp3"
);
audioList
.
add
(
englishPeople
+
"qing.mp3"
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/mortals/xhx/tts/utils/SpliceMp3Util.java
View file @
8d5e9bb1
package
com.mortals.xhx.tts.utils
;
package
com.mortals.xhx.tts.utils
;
import
com.mortals.xhx.tts.UI.MainWindow
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.aspectj.util.FileUtil
;
import
org.aspectj.util.FileUtil
;
import
java.io.*
;
import
java.io.*
;
...
@@ -18,10 +21,16 @@ public class SpliceMp3Util {
...
@@ -18,10 +21,16 @@ public class SpliceMp3Util {
*
*
*/
*/
public
static
String
fenLiData
(
String
path
)
throws
IOException
{
public
static
String
fenLiData
(
String
path
)
throws
IOException
{
File
file
=
new
File
(
path
);
// 原文件
ClassLoader
classLoader
=
MainWindow
.
class
.
getClassLoader
();
InputStream
inputStream
=
classLoader
.
getResourceAsStream
(
path
);
File
tempFile
=
File
.
createTempFile
(
"tmp"
,
"mp3"
);
tempFile
.
deleteOnExit
();
try
(
FileOutputStream
out
=
new
FileOutputStream
(
tempFile
))
{
IOUtils
.
copy
(
inputStream
,
out
);
}
File
file1
=
new
File
(
path
+
"01"
);
// 分离ID3V2后的文件,这是个中间文件,最后要被删除
File
file1
=
new
File
(
path
+
"01"
);
// 分离ID3V2后的文件,这是个中间文件,最后要被删除
File
file2
=
new
File
(
path
+
"001"
);
// 分离id3v1后的文件
File
file2
=
new
File
(
path
+
"001"
);
// 分离id3v1后的文件
RandomAccessFile
rf
=
new
RandomAccessFile
(
f
ile
,
"rw"
);
// 随机读取文件
RandomAccessFile
rf
=
new
RandomAccessFile
(
tempF
ile
,
"rw"
);
// 随机读取文件
FileOutputStream
fos
=
new
FileOutputStream
(
file1
);
FileOutputStream
fos
=
new
FileOutputStream
(
file1
);
byte
ID3
[]
=
new
byte
[
3
];
byte
ID3
[]
=
new
byte
[
3
];
rf
.
read
(
ID3
);
rf
.
read
(
ID3
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment