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
646e6d81
Commit
646e6d81
authored
Aug 22, 2024
by
周亚武
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改类文件读取规则
parent
41dcfb5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
17 deletions
+7
-17
src/main/java/com/mortals/xhx/tts/UI/MainWindow.java
src/main/java/com/mortals/xhx/tts/UI/MainWindow.java
+7
-17
No files found.
src/main/java/com/mortals/xhx/tts/UI/MainWindow.java
View file @
646e6d81
...
...
@@ -15,10 +15,7 @@ import javax.swing.*;
import
java.awt.*
;
import
java.awt.event.WindowEvent
;
import
java.awt.event.WindowListener
;
import
java.io.BufferedInputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.*
;
import
java.util.*
;
import
java.util.List
;
import
java.util.concurrent.BlockingDeque
;
...
...
@@ -273,20 +270,13 @@ public class MainWindow {
}
private
void
scanVoice
(){
try
{
ClassPathResource
classPathResource
=
new
ClassPathResource
(
people
+
"0.mp3"
);
File
file
=
classPathResource
.
getFile
();
if
(
file
.
exists
()){
pushInitMsg
(
"播音员("
+
speaker
+
")检测成功"
);
}
else
{
pushInitMsg
(
"播音员("
+
speaker
+
")检测失败,文件不存在"
);
}
}
catch
(
IOException
e
)
{
pushInitMsg
(
"播音员("
+
speaker
+
")检测失败 ->"
+
e
);
throw
new
RuntimeException
(
e
);
ClassLoader
classLoader
=
MainWindow
.
class
.
getClassLoader
();
InputStream
inputStream
=
classLoader
.
getResourceAsStream
(
people
+
"0.mp3"
);
if
(
inputStream
!=
null
){
pushInitMsg
(
"播音员("
+
speaker
+
")检测成功"
);
}
else
{
pushInitMsg
(
"播音员("
+
speaker
+
")检测失败,文件不存在"
);
}
}
/**
...
...
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