salmanmapkar commited on
Commit
34d98f2
1 Parent(s): efbaaad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -130,9 +130,9 @@ def AudioTranscribe(NumberOfSpeakers=None, SpeakerNames="", audio="", retries=5)
130
  subprocess.call(['ffmpeg', '-i', audio,'temp_audio.wav'])
131
  except Exception as ex:
132
  traceback.print_exc()
133
- return AudioTranscribe(audio, retries-1)
134
  if not (os.path.isfile("temp_audio.wav")):
135
- return AudioTranscribe(audio, retries-1)
136
  return Transcribe(NumberOfSpeakers, SpeakerNames)
137
  else:
138
  raise gr.Error("There is some issue ith Audio Transcriber. Please try again later!")
@@ -144,9 +144,9 @@ def VideoTranscribe(NumberOfSpeakers=None, SpeakerNames="", video="", retries=5)
144
  subprocess.call(command, shell=True)
145
  except Exception as ex:
146
  traceback.print_exc()
147
- return VideoTranscribe(video, retries-1)
148
  if not (os.path.isfile("temp_audio.wav")):
149
- return VideoTranscribe(video, retries-1)
150
  return Transcribe(NumberOfSpeakers, SpeakerNames)
151
  else:
152
  raise gr.Error("There is some issue ith Video Transcriber. Please try again later!")
@@ -170,7 +170,7 @@ def YoutubeTranscribe(NumberOfSpeakers=None, SpeakerNames="", URL="", retries =
170
  with youtube_dl.YoutubeDL(ydl_opts) as ydl:
171
  ydl.download([URL])
172
  except:
173
- return YoutubeTranscribe(URL, retries-1)
174
  stream = ffmpeg.input('temp_audio.m4a')
175
  stream = ffmpeg.output(stream, 'temp_audio.wav')
176
  RemoveFile("temp_audio.m4a")
 
130
  subprocess.call(['ffmpeg', '-i', audio,'temp_audio.wav'])
131
  except Exception as ex:
132
  traceback.print_exc()
133
+ return AudioTranscribe(NumberOfSpeakers, SpeakerNames, audio, retries-1)
134
  if not (os.path.isfile("temp_audio.wav")):
135
+ return AudioTranscribe(NumberOfSpeakers, SpeakerNames, audio, retries-1)
136
  return Transcribe(NumberOfSpeakers, SpeakerNames)
137
  else:
138
  raise gr.Error("There is some issue ith Audio Transcriber. Please try again later!")
 
144
  subprocess.call(command, shell=True)
145
  except Exception as ex:
146
  traceback.print_exc()
147
+ return VideoTranscribe(NumberOfSpeakers, SpeakerNames, video, retries-1)
148
  if not (os.path.isfile("temp_audio.wav")):
149
+ return VideoTranscribe(NumberOfSpeakers, SpeakerNames, video, retries-1)
150
  return Transcribe(NumberOfSpeakers, SpeakerNames)
151
  else:
152
  raise gr.Error("There is some issue ith Video Transcriber. Please try again later!")
 
170
  with youtube_dl.YoutubeDL(ydl_opts) as ydl:
171
  ydl.download([URL])
172
  except:
173
+ return YoutubeTranscribe(NumberOfSpeakers, SpeakerNames, URL, retries-1)
174
  stream = ffmpeg.input('temp_audio.m4a')
175
  stream = ffmpeg.output(stream, 'temp_audio.wav')
176
  RemoveFile("temp_audio.m4a")