Skip to content

Commit 67f71e5

Browse files
committed
Merge branch 'dev' into alpha
2 parents e50e080 + d9a474b commit 67f71e5

36 files changed

+2027
-1286
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ MANIFEST
1717
/.build_and_dist_win32
1818
/.release
1919
*.po~
20+
Pipfile
21+
*.lock

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
## TOC
1111

1212
- [Unreleased](#unreleased)
13+
- [0.5.4-alpha - 2020-01-31](#054-alpha---2020-01-31)
14+
- [Added](#added054-alpha)
15+
- [Changed](#changed054-alpha)
1316
- [0.5.3-alpha - 2019-12-30](#053-alpha---2019-12-30)
1417
- [Changed](#changed053-alpha)
1518
- [0.5.2-alpha - 2019-11-05](#052-alpha---2019-11-05)
@@ -29,7 +32,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2932

3033
Click up arrow to go back to TOC.
3134

32-
### [Unreleased]
35+
### Unreleased
36+
37+
### [0.5.4-alpha] - 2020-01-31
38+
39+
#### Added(0.5.4-alpha)
40+
41+
- Add basic Google Cloud Speech-to-Text support. [issue #10](https://github.com/BingLingGroup/autosub/issues/10)
42+
- Add more bilingual subtitles formats output support. [issue #72](https://github.com/BingLingGroup/autosub/issues/72)
43+
44+
#### Changed(0.5.4-alpha)
45+
46+
- Fix output format limits when input is a subtitles file.
47+
- Remove gtransv2 support.
3348

3449
### [0.5.3-alpha] - 2019-12-30
3550

@@ -156,7 +171,8 @@ Click up arrow to go back to TOC.
156171

157172
<escape><a href = "#TOC">&nbsp;&nbsp;</a></escape>
158173

159-
[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.3-alpha...HEAD
174+
[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.4-alpha...HEAD
175+
[0.5.4-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.3-alpha...0.5.4-alpha
160176
[0.5.3-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.2-alpha...0.5.3-alpha
161177
[0.5.2-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...0.5.2-alpha
162178
[0.5.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.0-alpha...0.5.1-alpha

README.md

Lines changed: 167 additions & 76 deletions
Large diffs are not rendered by default.

autosub/__init__.py

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,21 @@ def main(): # pylint: disable=too-many-branches, too-many-statements, too-many-
6969
if not ffmpeg_cmd:
7070
raise exceptions.AutosubException(
7171
_("Error: Dependency ffmpeg"
72-
" not found on this machine.")
73-
)
72+
" not found on this machine."))
7473

7574
ffmpeg_cmd = ffmpeg_cmd + ' '
7675

76+
cmdline_utils.fix_args(args,
77+
ffmpeg_cmd=ffmpeg_cmd)
78+
7779
if args.audio_process:
7880
args.audio_process = {k.lower() for k in args.audio_process}
7981
args.audio_process = \
8082
args.audio_process & constants.DEFAULT_AUDIO_PRCS_MODE_SET
8183
if not args.audio_process:
8284
raise exceptions.AutosubException(
8385
_("Error: The args of \"-ap\"/\"--audio-process\" are wrong."
84-
"\nNo works done.")
85-
)
86+
"\nNo works done."))
8687
if 'o' in args.audio_process:
8788
args.keep = True
8889
prcs_file = ffmpeg_utils.audio_pre_prcs(
@@ -91,17 +92,14 @@ def main(): # pylint: disable=too-many-branches, too-many-statements, too-many-
9192
cmds=args.audio_process_cmd,
9293
output_name=args.output,
9394
input_m=input_m,
94-
ffmpeg_cmd=ffmpeg_cmd
95-
)
95+
ffmpeg_cmd=ffmpeg_cmd)
9696
if not prcs_file:
9797
raise exceptions.AutosubException(
98-
_("No works done.")
99-
)
100-
else:
101-
args.input = prcs_file
102-
raise exceptions.AutosubException(
103-
_("Audio pre-processing complete.\nAll works done.")
104-
)
98+
_("No works done."))
99+
100+
args.input = prcs_file
101+
raise exceptions.AutosubException(
102+
_("Audio pre-processing complete.\nAll works done."))
105103

106104
if 's' in args.audio_process:
107105
args.keep = True
@@ -113,33 +111,40 @@ def main(): # pylint: disable=too-many-branches, too-many-statements, too-many-
113111
cmds=args.audio_process_cmd,
114112
output_name=args.output,
115113
input_m=input_m,
116-
ffmpeg_cmd=ffmpeg_cmd
117-
)
114+
ffmpeg_cmd=ffmpeg_cmd)
115+
args.audio_split_cmd = \
116+
args.audio_split_cmd.replace(
117+
"-vn -ac [channel] -ar [sample_rate] ", "")
118118
if not prcs_file:
119-
no_audio_prcs = False
119+
print(_("Audio pre-processing failed."
120+
"\nUse default method."))
120121
else:
121122
args.input = prcs_file
122123
print(_("Audio pre-processing complete."))
123-
no_audio_prcs = True
124-
elif 'n' in args.audio_process:
125-
print(_("No extra check/conversion "
126-
"before the speech-to-text procedure."))
127-
no_audio_prcs = True
128-
else:
129-
no_audio_prcs = False
130124

131125
else:
132-
no_audio_prcs = False
126+
args.audio_split_cmd = \
127+
args.audio_split_cmd.replace(
128+
"[channel]",
129+
"{channel}".format(channel=args.api_audio_channel))
130+
args.audio_split_cmd = \
131+
args.audio_split_cmd.replace(
132+
"[sample_rate]",
133+
"{sample_rate}".format(sample_rate=args.api_sample_rate))
134+
135+
if args.api_suffix == ".ogg":
136+
# regard ogg as ogg_opus
137+
args.audio_split_cmd = \
138+
args.audio_split_cmd.replace(
139+
"-vn",
140+
"-vn -c:a libopus")
133141

134142
cmdline_utils.validate_aovp_args(args)
135-
cmdline_utils.fix_args(args,
136-
ffmpeg_cmd=ffmpeg_cmd)
137143
fps = cmdline_utils.get_fps(args=args, input_m=input_m)
138144
cmdline_utils.audio_or_video_prcs(args,
139145
fps=fps,
140146
input_m=input_m,
141-
styles_list=styles_list,
142-
no_audio_prcs=no_audio_prcs)
147+
styles_list=styles_list)
143148

144149
elif validate_result == 1:
145150
cmdline_utils.validate_sp_args(args)

0 commit comments

Comments
 (0)