vsrinivas commited on
Commit
89524ee
1 Parent(s): dd25a11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -29
app.py CHANGED
@@ -7,7 +7,7 @@ from datetime import datetime
7
  import os
8
  import time
9
  from pydub import AudioSegment
10
- from IPython.display import Audio, display, Video, HTML
11
  # import assemblyai as aai
12
  from base64 import b64encode
13
  import gradio as gr
@@ -149,16 +149,13 @@ def summarize(meeting_texts=meeting_texts):
149
  minutes_of_meeting += summary
150
  minutes_of_meeting = minutes_of_meeting.replace('User:', '').strip()
151
  print("\n")
152
- print(minutes_of_meeting)
153
  return minutes_of_meeting
154
 
155
 
156
  # Placeholder function for speech to text conversion
157
  def speech_to_text(video):
158
  print('Started transcribing')
159
- # transcript = transcriber.transcribe(video).text
160
- # print('transcript:', transcript)
161
- # transcript = transcriber.transcribe(video).text
162
  audio = AudioSegment.from_file(video, format="mp4")
163
  audio.export('temp.mp3', format="mp3")
164
  transcript= transcriber.transcribe('temp.mp3')['text']
@@ -181,14 +178,6 @@ def synthesize_speech(video, source_language,target_language):
181
  file_format = 'audio/mpeg',
182
  source_language = source_language,
183
  target_language = target_language)
184
- # mp4 = open(dub_video,'rb').read()
185
- # video_url = "data:video/mp4;base64," + b64encode(mp4).decode()
186
- # display(HTML("""
187
- # <video width=400 controls>
188
- # <source src="%s" type="video/mp4">
189
- # </video>
190
- # """ % video_url))
191
- # print(dub_video)
192
  return dub_video
193
 
194
  # This function handles the processing when any participant speaks
@@ -221,22 +210,7 @@ def process_speaker(video, speaker_idx, n_participants, *language_list):
221
  meeting_texts.append({f"Speaker_{speaker_idx+1}":outputs[0]})
222
  else:
223
  meeting_texts.append({f"Speaker_{speaker_idx+1}":outputs[1]})
224
- # for i in range(n_participants):
225
-
226
- # if i == speaker_idx:
227
- # # outputs.append(transcript)
228
- # outputs.insert(0, transcript)
229
- # # outputs.insert(1, None)
230
- # else:
231
- # participant_language = language_codes[language_list[i]]
232
- # print('participant_language:', participant_language)
233
- # speaker_language = language_codes[language_list[speaker_idx]]
234
- # print('speaker_language:', speaker_language)
235
-
236
- # translated_text = translate_text(transcript, speaker_language, participant_language)
237
- # dubbed_video = synthesize_speech(video, speaker_language, participant_language)
238
- # outputs.append(translated_text)
239
- # outputs.append(dubbed_video)
240
  print(len(outputs))
241
  print(outputs)
242
  print('meeting_texts: ',meeting_texts)
 
7
  import os
8
  import time
9
  from pydub import AudioSegment
10
+ # from IPython.display import Audio, display, Video, HTML
11
  # import assemblyai as aai
12
  from base64 import b64encode
13
  import gradio as gr
 
149
  minutes_of_meeting += summary
150
  minutes_of_meeting = minutes_of_meeting.replace('User:', '').strip()
151
  print("\n")
152
+ print("minutes_of_meeting:", minutes_of_meeting)
153
  return minutes_of_meeting
154
 
155
 
156
  # Placeholder function for speech to text conversion
157
  def speech_to_text(video):
158
  print('Started transcribing')
 
 
 
159
  audio = AudioSegment.from_file(video, format="mp4")
160
  audio.export('temp.mp3', format="mp3")
161
  transcript= transcriber.transcribe('temp.mp3')['text']
 
178
  file_format = 'audio/mpeg',
179
  source_language = source_language,
180
  target_language = target_language)
 
 
 
 
 
 
 
 
181
  return dub_video
182
 
183
  # This function handles the processing when any participant speaks
 
210
  meeting_texts.append({f"Speaker_{speaker_idx+1}":outputs[0]})
211
  else:
212
  meeting_texts.append({f"Speaker_{speaker_idx+1}":outputs[1]})
213
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  print(len(outputs))
215
  print(outputs)
216
  print('meeting_texts: ',meeting_texts)