Spaces:
Runtime error
Runtime error
Commit
·
569a0c7
1
Parent(s):
1c4db4e
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,7 +104,7 @@ def Transcribe(audio="temp_audio.wav"):
|
|
| 104 |
RemoveAllFiles()
|
| 105 |
return (t_text, ({ "data": [{"speaker": speaker, "text": text} for speaker, text in conversation]}))
|
| 106 |
|
| 107 |
-
def AudioTranscribe(NumberOfSpeakers=None, SpeakerNames="", audio, retries=5):
|
| 108 |
if retries:
|
| 109 |
try:
|
| 110 |
subprocess.call(['ffmpeg', '-i', audio,'temp_audio.wav'])
|
|
@@ -117,7 +117,7 @@ def AudioTranscribe(NumberOfSpeakers=None, SpeakerNames="", audio, retries=5):
|
|
| 117 |
else:
|
| 118 |
raise gr.Error("There is some issue ith Audio Transcriber. Please try again later!")
|
| 119 |
|
| 120 |
-
def VideoTranscribe(NumberOfSpeakers=None, SpeakerNames="", video, retries=5):
|
| 121 |
if retries:
|
| 122 |
try:
|
| 123 |
command = f"ffmpeg -i {video} -ab 160k -ac 2 -ar 44100 -vn temp_audio.wav"
|
|
@@ -132,7 +132,7 @@ def VideoTranscribe(NumberOfSpeakers=None, SpeakerNames="", video, retries=5):
|
|
| 132 |
raise gr.Error("There is some issue ith Video Transcriber. Please try again later!")
|
| 133 |
return Transcribe()
|
| 134 |
|
| 135 |
-
def YoutubeTranscribe(NumberOfSpeakers=None, SpeakerNames="", URL, retries = 5):
|
| 136 |
if retries:
|
| 137 |
if "youtu" not in URL.lower():
|
| 138 |
raise gr.Error(f"{URL} is not a valid youtube URL.")
|
|
|
|
| 104 |
RemoveAllFiles()
|
| 105 |
return (t_text, ({ "data": [{"speaker": speaker, "text": text} for speaker, text in conversation]}))
|
| 106 |
|
| 107 |
+
def AudioTranscribe(NumberOfSpeakers=None, SpeakerNames="", audio="", retries=5):
|
| 108 |
if retries:
|
| 109 |
try:
|
| 110 |
subprocess.call(['ffmpeg', '-i', audio,'temp_audio.wav'])
|
|
|
|
| 117 |
else:
|
| 118 |
raise gr.Error("There is some issue ith Audio Transcriber. Please try again later!")
|
| 119 |
|
| 120 |
+
def VideoTranscribe(NumberOfSpeakers=None, SpeakerNames="", video="", retries=5):
|
| 121 |
if retries:
|
| 122 |
try:
|
| 123 |
command = f"ffmpeg -i {video} -ab 160k -ac 2 -ar 44100 -vn temp_audio.wav"
|
|
|
|
| 132 |
raise gr.Error("There is some issue ith Video Transcriber. Please try again later!")
|
| 133 |
return Transcribe()
|
| 134 |
|
| 135 |
+
def YoutubeTranscribe(NumberOfSpeakers=None, SpeakerNames="", URL="", retries = 5):
|
| 136 |
if retries:
|
| 137 |
if "youtu" not in URL.lower():
|
| 138 |
raise gr.Error(f"{URL} is not a valid youtube URL.")
|