Spaces:
Sleeping
Sleeping
import streamlit as st | |
from configure import auth_key | |
from real_time_transcription import * | |
from file_transcription import * | |
from tts import * | |
from transcript import * | |
def separator(): | |
liste = [] | |
for i in range(0,25): | |
liste.append("_") | |
st.sidebar.write(''.join(liste)) | |
def separators(): | |
liste = [] | |
for i in range(0,25): | |
liste.append("_") | |
st.markdown(''.join(liste)) | |
# Accueil | |
def main(): | |
# Menu latéral | |
st.sidebar.image("img/logo_inoni.png") | |
st.sidebar.write("<h1 style='text-align:center;'> Menu </h1>",unsafe_allow_html=True) | |
menus = ["Accueil","Transcription en temps réel", "Tanscrire un fichier","Text-to-speech"] | |
choice = st.sidebar.selectbox("",menus) | |
separator() | |
st.sidebar.write("Nous contacter: ") | |
st.sidebar.write(" - LinkedIn: Steve NGAMBEKET ") | |
st.sidebar.write(" - E-mail: steve.njoya.2000@gmail.com / fthvin12@outlook.com") | |
st.sidebar.write(" - Whatsapp: (+237) 655-921-477") | |
separator() | |
st.sidebar.write("<footer> <p> Copyright ©Steve NGAMBEKET NJOYA </footer>",unsafe_allow_html=True) | |
#Transcription en temps réel | |
if choice == "Accueil": | |
# Accueil | |
st.markdown("<h1 style='text-align:center;'>Reconnaissance vocale <br></h1>",unsafe_allow_html=True) | |
st.markdown("<h4 style='text-align:center;'>Speech-to-text / Text-to-Speech<br></h2>",unsafe_allow_html=True) | |
st.markdown("<br><br><br><br><br><br>",unsafe_allow_html=True) | |
#part1, part3 = st.columns(2) | |
separators() | |
st.subheader("Speech to Text") | |
st.image("img/pstt2.png", width=500) | |
#separators() | |
separators() | |
#st.markdown("<p style=''text-align:center;'>Text-to-speech</p>",unsafe_allow_html=True) | |
st.subheader("Text-to-Speech") | |
st.image("img/pstt (1).jpg", width=500) | |
#separators() | |
elif choice == "Transcription en temps réel": | |
st.title("Transcription en temps réel ") | |
separators() | |
rtt() | |
elif choice == "Tanscrire un fichier": | |
st.title("Tanscrire un fichier audio") | |
separators() | |
modes = ["Choisir un fichier", "Faire un enregistrement"] | |
mode = st.selectbox("", modes) | |
if mode == "Faire un enregistrement": | |
st.subheader("Lancer un enregistrement...") | |
tr = voice_rec() | |
#st.button("Lancer la transcription", on_click=rec_tr) | |
#st.button("Exporter dans un fichier text", on_click=save_transcript) | |
st.button("Sauvegarder le fichier text", on_click=save_transcript(tr)) | |
else: | |
tr = choose_file_trans() | |
#filename = st.file_uploader("Selectionnez votre fichier", type=["wav"]) | |
#audio_url = upload(filename) | |
st.button("Sauvegarder le fichier text", on_click=save_transcript(tr)) | |
else: | |
st.title("Text-to-Speech") | |
separators() | |
proceed() | |
if __name__ == '__main__': | |
main() | |