Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,6 @@ from gtts import gTTS
|
|
20 |
from IPython.display import Audio, display
|
21 |
|
22 |
from pydub import AudioSegment
|
23 |
-
import simpleaudio as sa
|
24 |
|
25 |
#์ฌ์ดํธ ๊ด๋ จ ํจ์
|
26 |
def main():
|
@@ -88,13 +87,10 @@ def main():
|
|
88 |
tts.save('output.mp3') # ์์ฑ ํ์ผ ์ ์ฅ
|
89 |
|
90 |
# ์์ฑ ํ์ผ ๋ก๋
|
91 |
-
audio = AudioSegment.from_file("output.mp3")
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
wave_obj = sa.WaveObject.from_wave_file("temp.wav")
|
96 |
-
play_obj = wave_obj.play()
|
97 |
-
play_obj.wait_done()
|
98 |
|
99 |
st.markdown(response)
|
100 |
with st.expander("์ฐธ๊ณ ๋ฌธ์ ํ์ธ"):
|
|
|
20 |
from IPython.display import Audio, display
|
21 |
|
22 |
from pydub import AudioSegment
|
|
|
23 |
|
24 |
#์ฌ์ดํธ ๊ด๋ จ ํจ์
|
25 |
def main():
|
|
|
87 |
tts.save('output.mp3') # ์์ฑ ํ์ผ ์ ์ฅ
|
88 |
|
89 |
# ์์ฑ ํ์ผ ๋ก๋
|
90 |
+
audio = AudioSegment.from_file("output.mp3", format="mp3")
|
91 |
+
|
92 |
+
# Streamlit์์ ์์ฑ ์ฌ์
|
93 |
+
st.audio(audio.export(format='mp3').read(), format='audio/mp3')
|
|
|
|
|
|
|
94 |
|
95 |
st.markdown(response)
|
96 |
with st.expander("์ฐธ๊ณ ๋ฌธ์ ํ์ธ"):
|