lelafav502 commited on
Commit
e7a6721
·
verified ·
1 Parent(s): c1544ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import json
2
  from faster_whisper import WhisperModel # Assuming you have installed this library
3
 
@@ -62,6 +63,12 @@ def transcribe_audio(audiofilename):
62
  linelevel_subtitles = split_text_into_lines(wordlevel_info)
63
  return linelevel_subtitles
64
 
65
- audiofile = "Intro.mp3" # Assuming you've uploaded the audio file as "input.mp3"
66
- transcription = transcribe_audio(audiofile)
67
- print(json.dumps(transcription, indent=4))
 
 
 
 
 
 
 
1
+ import gradio as gr
2
  import json
3
  from faster_whisper import WhisperModel # Assuming you have installed this library
4
 
 
63
  linelevel_subtitles = split_text_into_lines(wordlevel_info)
64
  return linelevel_subtitles
65
 
66
+ def audio_transcription(audiofile):
67
+ transcription = transcribe_audio(audiofile)
68
+ return json.dumps(transcription, indent=4)
69
+
70
+ iface = gr.Interface(audio_transcription,
71
+ gr.inputs.Audio(sources="upload", type="file"),
72
+ "text",
73
+ description="Upload an audio file and get its transcription in JSON format.")
74
+ iface.launch()