kabita-choudhary commited on
Commit
fdc4fd8
·
1 Parent(s): ac543ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -28,18 +28,17 @@ def diarization(inp_audio):
28
 
29
 
30
  def generatetext(filename,starttime,endtime):
31
-
32
- t1 = starttime * 1000 # works in milliseconds
33
- t2 = endtime * 1000
34
-
35
- newAudio = AudioSegment.from_wav(filename)
36
- a = newAudio[t1:t2]
37
- a.export('audio.wav', format="wav")
38
- audio = whisper.load_audio('audio.wav')
39
- result= model.transcribe(audio)
40
  #text1 = whisper('audio.wav')
41
- return result.get("text")
42
-
 
43
  block = gr.Blocks()
44
  with block:
45
  with gr.Group():
 
28
 
29
 
30
  def generatetext(filename,starttime,endtime):
31
+ t1 = starttime * 1000 # works in milliseconds
32
+ t2 = endtime * 1000
33
+ newAudio = AudioSegment.from_wav(filename)
34
+ a = newAudio[t1:t2]
35
+ a.export('audio.wav', format="wav")
36
+ audio = whisper.load_audio('audio.wav')
37
+ result= model.transcribe(audio)
 
 
38
  #text1 = whisper('audio.wav')
39
+ print(result)
40
+ print(result.get("text"))
41
+ return result.get("text")
42
  block = gr.Blocks()
43
  with block:
44
  with gr.Group():