Update app.py
Browse files
app.py
CHANGED
|
@@ -10,9 +10,7 @@ translation accuracy and tone. Ideal for showcasing real-world multilingual API
|
|
| 10 |
import streamlit as st
|
| 11 |
from elevenlabs.client import ElevenLabs
|
| 12 |
from groq import Groq
|
| 13 |
-
import
|
| 14 |
-
import base64
|
| 15 |
-
from io import BytesIO
|
| 16 |
|
| 17 |
# ======CONFIGURATION========
|
| 18 |
GROQ_API_KEY = st.secrets["GROQ_API_KEY"]
|
|
@@ -34,7 +32,7 @@ HEADERS = {
|
|
| 34 |
def transcribe_audio(audio_file):
|
| 35 |
st.info("Transcribing audio...")
|
| 36 |
# Transcribe audio using ElevenLabs API
|
| 37 |
-
audio_data =
|
| 38 |
transcription = client_el.speech_to_text.convert(
|
| 39 |
file=audio_data,
|
| 40 |
model_id="scribe_v1",
|
|
|
|
| 10 |
import streamlit as st
|
| 11 |
from elevenlabs.client import ElevenLabs
|
| 12 |
from groq import Groq
|
| 13 |
+
from pydub import AudioSegment
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# ======CONFIGURATION========
|
| 16 |
GROQ_API_KEY = st.secrets["GROQ_API_KEY"]
|
|
|
|
| 32 |
def transcribe_audio(audio_file):
|
| 33 |
st.info("Transcribing audio...")
|
| 34 |
# Transcribe audio using ElevenLabs API
|
| 35 |
+
audio_data = AudioSegment.from_file(audio_file)
|
| 36 |
transcription = client_el.speech_to_text.convert(
|
| 37 |
file=audio_data,
|
| 38 |
model_id="scribe_v1",
|