Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,13 +14,17 @@ st.title("Voice Cloning Application")
|
|
14 |
st.markdown("Clone your voice using Groq's Whisper Model and generate natural responses.")
|
15 |
|
16 |
# Upload audio file
|
17 |
-
uploaded_file = st.file_uploader(
|
|
|
|
|
|
|
18 |
|
19 |
if uploaded_file is not None:
|
20 |
-
|
|
|
21 |
st.write("Transcription in progress...")
|
22 |
|
23 |
-
#
|
24 |
try:
|
25 |
transcription = client.chat.completions.create(
|
26 |
messages=[
|
@@ -37,22 +41,20 @@ if uploaded_file is not None:
|
|
37 |
st.success("Transcription completed!")
|
38 |
st.write("**Transcribed Text:**", transcribed_text)
|
39 |
|
40 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
except Exception as e:
|
43 |
st.error(f"Error during transcription: {e}")
|
44 |
|
45 |
-
# Text-to-Speech (Optional)
|
46 |
-
st.markdown("---")
|
47 |
-
st.subheader("Generate Speech from Transcription")
|
48 |
-
tts_input = st.text_area("Enter text to generate speech:")
|
49 |
-
|
50 |
-
if st.button("Generate Speech"):
|
51 |
-
if tts_input:
|
52 |
-
# Simulate TTS functionality (add actual TTS model later)
|
53 |
-
st.success("Generated speech successfully! (Placeholder)")
|
54 |
-
else:
|
55 |
-
st.warning("Please enter some text.")
|
56 |
-
|
57 |
# Footer
|
58 |
st.markdown("Developed with ❤️ by Sanam Iftakhar")
|
|
|
14 |
st.markdown("Clone your voice using Groq's Whisper Model and generate natural responses.")
|
15 |
|
16 |
# Upload audio file
|
17 |
+
uploaded_file = st.file_uploader(
|
18 |
+
"Upload your audio file for transcription",
|
19 |
+
type=["wav", "mp3", "mp4", "m4a"]
|
20 |
+
)
|
21 |
|
22 |
if uploaded_file is not None:
|
23 |
+
# Display uploaded audio
|
24 |
+
st.audio(uploaded_file, format=f"audio/{uploaded_file.type.split('.')[-1]}")
|
25 |
st.write("Transcription in progress...")
|
26 |
|
27 |
+
# Transcription Logic
|
28 |
try:
|
29 |
transcription = client.chat.completions.create(
|
30 |
messages=[
|
|
|
41 |
st.success("Transcription completed!")
|
42 |
st.write("**Transcribed Text:**", transcribed_text)
|
43 |
|
44 |
+
# Placeholder for voice cloning (TTS integration can go here)
|
45 |
+
st.markdown("---")
|
46 |
+
st.subheader("Generate Speech from Transcription")
|
47 |
+
tts_input = st.text_area("Enter text to generate speech:", value=transcribed_text)
|
48 |
+
|
49 |
+
if st.button("Generate Speech"):
|
50 |
+
if tts_input:
|
51 |
+
# Simulate TTS functionality (placeholder for TTS model integration)
|
52 |
+
st.success("Generated speech successfully! (Placeholder)")
|
53 |
+
else:
|
54 |
+
st.warning("Please enter some text.")
|
55 |
|
56 |
except Exception as e:
|
57 |
st.error(f"Error during transcription: {e}")
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
# Footer
|
60 |
st.markdown("Developed with ❤️ by Sanam Iftakhar")
|