ziqiangao commited on
Commit
e7c405a
·
1 Parent(s): d782c33

update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -162,7 +162,7 @@ def main(file, name, fps=30, res: tuple=(1280,720), oscres=512, sr=11025, lyrics
162
  p = gr.Progress()
163
  if os.path.exists("out.srt"):
164
  os.remove("out.srt")
165
- lyrics = False
166
  if lyrics:
167
  p(0.5,"parsing lyrics")
168
  try:
@@ -172,11 +172,11 @@ def main(file, name, fps=30, res: tuple=(1280,720), oscres=512, sr=11025, lyrics
172
  gr.Info("Lyrics of LRC type was detected, converting to SRT")
173
  LRC2SRT.convert_to_srt(sf)
174
  outf.write('\n'.join(LRC2SRT.SRT))
175
- lyrics = True
176
  elif sf[0].isdigit():
177
  outf.write(sf)
178
  gr.Info("Lyrics of SRT type was detected")
179
- lyrics = True
180
  else:
181
  gr.Warning("Lyrics file is invalid, skipping")
182
  except:
@@ -230,7 +230,7 @@ def main(file, name, fps=30, res: tuple=(1280,720), oscres=512, sr=11025, lyrics
230
  p = gr.Progress()
231
  p(0.5,desc="Compiling video")
232
  print('FFMPEG')
233
- if lyrics:
234
  ffmpeg_cmd = [
235
  "ffmpeg",
236
  '-framerate', '30',
 
162
  p = gr.Progress()
163
  if os.path.exists("out.srt"):
164
  os.remove("out.srt")
165
+ haslyrics = False
166
  if lyrics:
167
  p(0.5,"parsing lyrics")
168
  try:
 
172
  gr.Info("Lyrics of LRC type was detected, converting to SRT")
173
  LRC2SRT.convert_to_srt(sf)
174
  outf.write('\n'.join(LRC2SRT.SRT))
175
+ haslyrics = True
176
  elif sf[0].isdigit():
177
  outf.write(sf)
178
  gr.Info("Lyrics of SRT type was detected")
179
+ haslyrics = True
180
  else:
181
  gr.Warning("Lyrics file is invalid, skipping")
182
  except:
 
230
  p = gr.Progress()
231
  p(0.5,desc="Compiling video")
232
  print('FFMPEG')
233
+ if haslyrics:
234
  ffmpeg_cmd = [
235
  "ffmpeg",
236
  '-framerate', '30',