Upload app.py
Browse files
app.py
CHANGED
|
@@ -103,15 +103,20 @@ def get_audio_duration(audio_path):
|
|
| 103 |
return 5.0 # 默认5秒
|
| 104 |
|
| 105 |
# 在生成ASS文件时添加完整样式头
|
| 106 |
-
ASS_STYLE_HEADER = """
|
|
|
|
| 107 |
WrapStyle: 0
|
| 108 |
ScaledBorderAndShadow: yes
|
| 109 |
PlayResX: 1920
|
| 110 |
PlayResY: 1080
|
|
|
|
| 111 |
[V4+ Styles]
|
| 112 |
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
|
| 113 |
-
|
| 114 |
-
Style:
|
|
|
|
|
|
|
|
|
|
| 115 |
[Events]
|
| 116 |
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
| 117 |
"""
|
|
|
|
| 103 |
return 5.0 # 默认5秒
|
| 104 |
|
| 105 |
# 在生成ASS文件时添加完整样式头
|
| 106 |
+
ASS_STYLE_HEADER = """
|
| 107 |
+
[Script Info]
|
| 108 |
WrapStyle: 0
|
| 109 |
ScaledBorderAndShadow: yes
|
| 110 |
PlayResX: 1920
|
| 111 |
PlayResY: 1080
|
| 112 |
+
|
| 113 |
[V4+ Styles]
|
| 114 |
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
|
| 115 |
+
; Caption样式:金黄色,带深紫描边,适合提示、注释标题
|
| 116 |
+
Style: Caption,Noto Sans CJK SC,46,&H00D7B700,&H0033B7FF,&H00333399,&H00000000,0,0,0,0,100,100,0,0,1,3,4,8,10,10,40,0
|
| 117 |
+
; Speech样式:天蓝色,带深蓝描边,适合对白
|
| 118 |
+
Style: Speech,Noto Sans CJK SC,42,&H00FFA500,&H005BBFFF,&H00222268,&H00000000,0,0,0,0,100,100,0,0,1,3,4,2,10,10,50,0
|
| 119 |
+
|
| 120 |
[Events]
|
| 121 |
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
| 122 |
"""
|