Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
accessibility_movie_1
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
翟艳秋(20软)
accessibility_movie_1
Commits
945a2b39
Commit
945a2b39
authored
Feb 18, 2022
by
翟艳秋(20软)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补前一次commit遗漏的部分
parent
172eb5d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
21 deletions
+29
-21
speech_synthesis.py
speech_synthesis.py
+1
-1
try_with_gui.py
try_with_gui.py
+28
-20
No files found.
speech_synthesis.py
View file @
945a2b39
...
...
@@ -36,7 +36,7 @@ def speech_synthesis(text, output_file, speed):
audio_config
=
AudioOutputConfig
(
filename
=
audio_path
)
synthesizer
=
SpeechSynthesizer
(
speech_config
=
speech_config
,
audio_config
=
audio_config
)
synthesizer
.
speak_text
_async
(
text
)
synthesizer
.
speak_text
(
text
)
if
float
(
speed
)
!=
1.0
:
change_speed
(
output_file
,
speed
)
...
...
try_with_gui.py
View file @
945a2b39
...
...
@@ -214,6 +214,18 @@ def start_synthesis():
caption_path
=
captionPath
.
get
()
# 判断各个变量的合理性
if
len
(
video_path
)
==
0
:
messagebox
.
showwarning
(
"警告"
,
"请给出原视频存放路径"
)
return
elif
not
os
.
path
.
exists
(
video_path
):
messagebox
.
showwarning
(
"警告"
,
"当前给出的视频路径有误,请检查一遍"
)
return
if
len
(
sheet_path
)
==
0
:
messagebox
.
showwarning
(
"警告"
,
"请选择你要处理的表格"
)
return
elif
not
os
.
path
.
exists
(
sheet_path
):
messagebox
.
showwarning
(
"警告"
,
"当前输入的表格不存在,请检查一遍。"
)
return
if
len
(
audio_dir
)
==
0
:
messagebox
.
showwarning
(
"警告"
,
"请选择音频存放路径"
)
return
...
...
@@ -222,11 +234,7 @@ def start_synthesis():
return
if
len
(
caption_path
)
==
0
:
messagebox
.
showwarning
(
"警告"
,
"请选择字幕文件存放路径"
)
if
len
(
sheet_path
)
==
0
:
messagebox
.
showwarning
(
"警告"
,
"请选择你要处理的表格"
)
return
elif
not
os
.
path
.
exists
(
sheet_path
):
messagebox
.
showwarning
(
"警告"
,
"当前输入的表格不存在,请检查一遍。"
)
# 显示进度条、进度条百分比及任务状态提示文本
startSynthesis
.
config
(
state
=
tk
.
DISABLED
)
...
...
@@ -320,10 +328,10 @@ tabControl.pack(expand=1, fill="both")
video_info
=
ttk
.
LabelFrame
(
tab1
,
text
=
" 视频信息操作 "
)
video_info
.
place
(
relx
=
0.05
,
rely
=
0.05
,
relwidth
=
0.9
,
relheight
=
0.4
)
rows
=
4
for
i
in
range
(
rows
):
video_info
.
grid_rowconfigure
(
i
,
weight
=
1
)
video_info
.
grid_columnconfigure
(
i
,
weight
=
1
)
#
rows = 4
#
for i in range(rows):
#
video_info.grid_rowconfigure(i, weight=1)
#
video_info.grid_columnconfigure(i, weight=1)
input_label
=
ttk
.
Label
(
video_info
,
text
=
"视频文件"
)
input_label
.
grid
(
column
=
0
,
row
=
0
)
...
...
@@ -364,10 +372,10 @@ choice_3.grid(column=3, row=3, sticky="W")
detect_command
=
ttk
.
LabelFrame
(
tab1
,
text
=
" 检测步骤 "
)
detect_command
.
place
(
relx
=
0.05
,
rely
=
0.6
,
relwidth
=
0.9
,
relheight
=
0.3
)
rows
=
4
for
i
in
range
(
rows
):
detect_command
.
grid_rowconfigure
(
i
,
weight
=
1
)
detect_command
.
grid_columnconfigure
(
i
,
weight
=
1
)
#
rows = 4
#
for i in range(rows):
#
detect_command.grid_rowconfigure(i, weight=1)
#
detect_command.grid_columnconfigure(i, weight=1)
output_label
=
ttk
.
Label
(
detect_command
,
text
=
"输出表格"
)
output_label
.
grid
(
column
=
0
,
row
=
0
)
...
...
@@ -401,10 +409,10 @@ stopDetection.config(state=tk.DISABLED)
audio_info
=
ttk
.
LabelFrame
(
tab2
,
text
=
" 语音相关设置 "
)
audio_info
.
place
(
relx
=
0.05
,
rely
=
0.05
,
relwidth
=
0.9
,
relheight
=
0.3
)
rows
=
3
for
i
in
range
(
rows
):
audio_info
.
grid_rowconfigure
(
i
,
weight
=
1
)
audio_info
.
grid_columnconfigure
(
i
,
weight
=
1
)
#
rows = 3
#
for i in range(rows):
#
audio_info.grid_rowconfigure(i, weight=1)
#
audio_info.grid_columnconfigure(i, weight=1)
video_label
=
ttk
.
Label
(
audio_info
,
text
=
"原视频"
)
video_label
.
grid
(
column
=
0
,
row
=
0
)
...
...
@@ -441,10 +449,10 @@ speedChosen.grid(column=1, row=2, sticky="W")
synthesis_command
=
ttk
.
LabelFrame
(
tab2
,
text
=
" 语音合成步骤 "
)
synthesis_command
.
place
(
relx
=
0.05
,
rely
=
0.45
,
relwidth
=
0.9
,
relheight
=
0.4
)
rows
=
4
for
i
in
range
(
rows
):
synthesis_command
.
grid_rowconfigure
(
i
,
weight
=
1
)
synthesis_command
.
grid_columnconfigure
(
i
,
weight
=
1
)
#
rows = 4
#
for i in range(rows):
#
synthesis_command.grid_rowconfigure(i, weight=1)
#
synthesis_command.grid_columnconfigure(i, weight=1)
audioDir_label
=
ttk
.
Label
(
synthesis_command
,
text
=
"输出音频存放于"
)
audioDir_label
.
grid
(
column
=
0
,
row
=
0
)
...
...
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