Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ import time
|
|
| 7 |
import base64
|
| 8 |
import tempfile
|
| 9 |
from google.cloud import texttospeech
|
|
|
|
| 10 |
from streamlit_webrtc import webrtc_streamer, WebRtcMode, AudioProcessorBase
|
| 11 |
|
| 12 |
# Configuraci贸n de la clave API
|
|
@@ -223,4 +224,10 @@ if page == "Chat Asistente":
|
|
| 223 |
st.session_state.mensajes.append({"role": "assistant", "content": respuesta, "timestamp": time.time()})
|
| 224 |
with st.chat_message("assistant"):
|
| 225 |
st.markdown(respuesta)
|
| 226 |
-
st.video("https://cdn.pika.art/v1/0fe46d03-efd2-49d8-86a2-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
import base64
|
| 8 |
import tempfile
|
| 9 |
from google.cloud import texttospeech
|
| 10 |
+
from google.cloud import speech
|
| 11 |
from streamlit_webrtc import webrtc_streamer, WebRtcMode, AudioProcessorBase
|
| 12 |
|
| 13 |
# Configuraci贸n de la clave API
|
|
|
|
| 224 |
st.session_state.mensajes.append({"role": "assistant", "content": respuesta, "timestamp": time.time()})
|
| 225 |
with st.chat_message("assistant"):
|
| 226 |
st.markdown(respuesta)
|
| 227 |
+
st.video("https://cdn.pika.art/v1/0fe46d03-efd2-49d8-86a2-9230769af8cd/Talking_seed1363056373525570.mp4", start_time=0)
|
| 228 |
+
|
| 229 |
+
# Convertir texto a voz
|
| 230 |
+
audio_base64 = text_to_speech_base64(respuesta)
|
| 231 |
+
audio_html = f"""
|
| 232 |
+
<audio autoplay>
|
| 233 |
+
<source src="data:audio/mp3;base
|