davidanthony-ai
commited on
Commit
·
bd326e8
1
Parent(s):
9e873a7
test aac
Browse files
components/fonctions_transcription.py
CHANGED
@@ -10,7 +10,8 @@ import pandas as pd
|
|
10 |
import plotly.express as px
|
11 |
from pydub import AudioSegment
|
12 |
import tempfile
|
13 |
-
|
|
|
14 |
|
15 |
# # Chargement du fichier des utilisateurs
|
16 |
# with open("users_info.json", 'r') as file:
|
@@ -271,3 +272,13 @@ def transcript(dict_user,username,user_group, audio_file,maintenant,Year_Month,q
|
|
271 |
return text_transcript
|
272 |
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
import plotly.express as px
|
11 |
from pydub import AudioSegment
|
12 |
import tempfile
|
13 |
+
import os
|
14 |
+
import subprocess
|
15 |
|
16 |
# # Chargement du fichier des utilisateurs
|
17 |
# with open("users_info.json", 'r') as file:
|
|
|
272 |
return text_transcript
|
273 |
|
274 |
|
275 |
+
|
276 |
+
|
277 |
+
def convert_audio_to_mp3(input_file):
|
278 |
+
# Créer un nom de fichier de sortie avec l'extension .mp3
|
279 |
+
output_file = os.path.splitext(input_file.name)[0] + ".mp3"
|
280 |
+
|
281 |
+
# Utiliser FFmpeg pour convertir le fichier audio en MP3
|
282 |
+
subprocess.run(["ffmpeg", "-i", input_file.name, "-codec:a", "libmp3lame", "-qscale:a", "2", output_file])
|
283 |
+
|
284 |
+
return output_file
|
pages/Transcription.py
CHANGED
@@ -72,7 +72,9 @@ if st.session_state["authenticated"]:
|
|
72 |
model = whisper.load_model("large")
|
73 |
st.text("Chargement du modèle terminé")
|
74 |
|
75 |
-
audio_file = st.file_uploader("Charger l'audio", type=["wav", "mp3", "m4a"])
|
|
|
|
|
76 |
#audio_file = st.file_uploader("Charger l'audio", accept='audio/*')
|
77 |
#audio_name = audio_file.name
|
78 |
|
|
|
72 |
model = whisper.load_model("large")
|
73 |
st.text("Chargement du modèle terminé")
|
74 |
|
75 |
+
audio_file = st.file_uploader("Charger l'audio", type=["wav", "mp3", "m4a","aac"])
|
76 |
+
audio_file = TRS.convert_audio_to_mp3(audio_file)
|
77 |
+
|
78 |
#audio_file = st.file_uploader("Charger l'audio", accept='audio/*')
|
79 |
#audio_name = audio_file.name
|
80 |
|