Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,15 +27,15 @@ def transcribe_audio(audio_bytes):
|
|
| 27 |
return transcription
|
| 28 |
|
| 29 |
# Function to open a file
|
| 30 |
-
def startfile(fn):
|
| 31 |
-
|
| 32 |
|
| 33 |
# Function to create and open a txt file
|
| 34 |
-
def create_and_open_txt(text, filename):
|
| 35 |
# Create and write the text to a txt file
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
| 40 |
# Streamlit app
|
| 41 |
st.title("Audio to Text Transcription..")
|
|
@@ -55,8 +55,8 @@ if audio_bytes:
|
|
| 55 |
else:
|
| 56 |
st.write("No audio recorded.")
|
| 57 |
# Detect the language
|
| 58 |
-
language = detect(transcription)
|
| 59 |
-
st.write(f"Detected language: {language}")
|
| 60 |
|
| 61 |
# Create and open a txt file with the text
|
| 62 |
-
create_and_open_txt(transcription, f"output_{language}.txt")
|
|
|
|
| 27 |
return transcription
|
| 28 |
|
| 29 |
# Function to open a file
|
| 30 |
+
#def startfile(fn):
|
| 31 |
+
# os.system('open %s' % fn)
|
| 32 |
|
| 33 |
# Function to create and open a txt file
|
| 34 |
+
#def create_and_open_txt(text, filename):
|
| 35 |
# Create and write the text to a txt file
|
| 36 |
+
# with open(filename, "w") as file:
|
| 37 |
+
# file.write(text)
|
| 38 |
+
# startfile(filename)
|
| 39 |
|
| 40 |
# Streamlit app
|
| 41 |
st.title("Audio to Text Transcription..")
|
|
|
|
| 55 |
else:
|
| 56 |
st.write("No audio recorded.")
|
| 57 |
# Detect the language
|
| 58 |
+
#language = detect(transcription)
|
| 59 |
+
#st.write(f"Detected language: {language}")
|
| 60 |
|
| 61 |
# Create and open a txt file with the text
|
| 62 |
+
#create_and_open_txt(transcription, f"output_{language}.txt")
|