Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,14 @@ import librosa
|
|
| 6 |
import srt
|
| 7 |
from datetime import timedelta
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# ๋ชจ๋ธ ๋ฐ ํ๋ก์ธ์ ๋ก๋
|
| 10 |
@st.cache_resource
|
| 11 |
def load_model():
|
|
@@ -91,11 +99,4 @@ if uploaded_files:
|
|
| 91 |
|
| 92 |
# ์ต์ข
SRT ํ์ผ ๋ค์ด๋ก๋ ๋ฒํผ
|
| 93 |
with open(final_srt_file_path, "rb") as srt_file:
|
| 94 |
-
st.download_button(label="SRT ํ์ผ ๋ค์ด๋ก๋", data=srt_file, file_name=final_srt_file_path, mime="text/srt")
|
| 95 |
-
|
| 96 |
-
def split_audio(audio, sr, segment_duration=5):
|
| 97 |
-
segments = []
|
| 98 |
-
for i in range(0, len(audio), int(segment_duration * sr)):
|
| 99 |
-
segment = audio[i:i + int(segment_duration * sr)]
|
| 100 |
-
segments.append(segment)
|
| 101 |
-
return segments
|
|
|
|
| 6 |
import srt
|
| 7 |
from datetime import timedelta
|
| 8 |
|
| 9 |
+
# ์ค๋์ค ํ์ผ์ 5์ด ๊ฐ๊ฒฉ์ผ๋ก ๋๋๋ ํจ์
|
| 10 |
+
def split_audio(audio, sr, segment_duration=5):
|
| 11 |
+
segments = []
|
| 12 |
+
for i in range(0, len(audio), int(segment_duration * sr)):
|
| 13 |
+
segment = audio[i:i + int(segment_duration * sr)]
|
| 14 |
+
segments.append(segment)
|
| 15 |
+
return segments
|
| 16 |
+
|
| 17 |
# ๋ชจ๋ธ ๋ฐ ํ๋ก์ธ์ ๋ก๋
|
| 18 |
@st.cache_resource
|
| 19 |
def load_model():
|
|
|
|
| 99 |
|
| 100 |
# ์ต์ข
SRT ํ์ผ ๋ค์ด๋ก๋ ๋ฒํผ
|
| 101 |
with open(final_srt_file_path, "rb") as srt_file:
|
| 102 |
+
st.download_button(label="SRT ํ์ผ ๋ค์ด๋ก๋", data=srt_file, file_name=final_srt_file_path, mime="text/srt")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|