Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -199,7 +199,7 @@ language_dict = {
|
|
| 199 |
'Croatian (Croatia)-Srecko (Male)': 'hr-HR-SreckoNeural',
|
| 200 |
'Hungarian (Hungary)-Noemi (Female)': 'hu-HU-NoemiNeural',
|
| 201 |
'Hungarian (Hungary)-Tamas (Male)': 'hu-HU-TamasNeural',
|
| 202 |
-
'Icelandic (Iceland)-Gudrun (Female)': 'is-IS-GudrunNeural',
|
| 203 |
'Icelandic (Iceland)-Gunnar (Male)': 'is-IS-GunnarNeural',
|
| 204 |
'Javanese (Indonesia)-Dimas (Male)': 'jv-ID-DimasNeural',
|
| 205 |
'Javanese (Indonesia)-Siti (Female)': 'jv-ID-SitiNeural',
|
|
@@ -246,48 +246,75 @@ for voice_name, voice_code in language_dict.items():
|
|
| 246 |
language_groups[language] = []
|
| 247 |
language_groups[language].append(voice_name)
|
| 248 |
|
| 249 |
-
# CSS for
|
| 250 |
st.markdown("""
|
| 251 |
<style>
|
|
|
|
| 252 |
.main {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
display: flex;
|
| 254 |
flex-direction: column;
|
| 255 |
align-items: center;
|
| 256 |
justify-content: center;
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
border-radius: 8px;
|
| 261 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
.stButton > button {
|
| 263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
margin-left: auto;
|
| 265 |
margin-right: auto;
|
|
|
|
|
|
|
|
|
|
| 266 |
background-color: #1f77b4;
|
| 267 |
color: #ffffff;
|
| 268 |
border-radius: 8px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
}
|
|
|
|
| 270 |
.stAudio {
|
| 271 |
display: flex;
|
| 272 |
justify-content: center;
|
| 273 |
}
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
background-color: #1f77b4;
|
| 279 |
-
color: #ffffff;
|
| 280 |
-
border-radius: 8px;
|
| 281 |
-
}
|
| 282 |
-
.stTextArea > div > div > textarea {
|
| 283 |
-
background-color: #262730;
|
| 284 |
-
color: #ffffff;
|
| 285 |
-
border-radius: 8px;
|
| 286 |
}
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
color: #
|
| 290 |
-
border-radius: 8px;
|
| 291 |
}
|
| 292 |
</style>
|
| 293 |
""", unsafe_allow_html=True)
|
|
@@ -300,7 +327,7 @@ async def text_to_speech_edge(text, voice):
|
|
| 300 |
return tmp_path
|
| 301 |
|
| 302 |
def main():
|
| 303 |
-
# Center the title and description with
|
| 304 |
st.markdown("<h1 style='text-align: center; color: #ffffff;'>Text-to-Speech Converter</h1>", unsafe_allow_html=True)
|
| 305 |
st.markdown("<p style='text-align: center; color: #ffffff;'>Enter text and select a language and voice to generate an MP3 audio file.</p>", unsafe_allow_html=True)
|
| 306 |
|
|
|
|
| 199 |
'Croatian (Croatia)-Srecko (Male)': 'hr-HR-SreckoNeural',
|
| 200 |
'Hungarian (Hungary)-Noemi (Female)': 'hu-HU-NoemiNeural',
|
| 201 |
'Hungarian (Hungary)-Tamas (Male)': 'hu-HU-TamasNeural',
|
| 202 |
+
'Icelandic (I Ascending (1)'>Icelandic (Iceland)-Gudrun (Female)': 'is-IS-GudrunNeural',
|
| 203 |
'Icelandic (Iceland)-Gunnar (Male)': 'is-IS-GunnarNeural',
|
| 204 |
'Javanese (Indonesia)-Dimas (Male)': 'jv-ID-DimasNeural',
|
| 205 |
'Javanese (Indonesia)-Siti (Female)': 'jv-ID-SitiNeural',
|
|
|
|
| 246 |
language_groups[language] = []
|
| 247 |
language_groups[language].append(voice_name)
|
| 248 |
|
| 249 |
+
# Comprehensive CSS for a true dark theme
|
| 250 |
st.markdown("""
|
| 251 |
<style>
|
| 252 |
+
/* Main container and background */
|
| 253 |
.main {
|
| 254 |
+
background-color: #000000 !important;
|
| 255 |
+
padding: 20px;
|
| 256 |
+
border-radius: 8px;
|
| 257 |
+
min-height: 100vh;
|
| 258 |
display: flex;
|
| 259 |
flex-direction: column;
|
| 260 |
align-items: center;
|
| 261 |
justify-content: center;
|
| 262 |
+
}
|
| 263 |
+
/* Override Streamlit's default white backgrounds */
|
| 264 |
+
.stApp {
|
| 265 |
+
background-color: #000000 !important;
|
| 266 |
+
}
|
| 267 |
+
.st-emotion-cache-1gv3atu {
|
| 268 |
+
background-color: #000000 !important;
|
| 269 |
+
}
|
| 270 |
+
/* Style for text area */
|
| 271 |
+
.stTextArea > div > div > textarea {
|
| 272 |
+
background-color: #1a1a1a;
|
| 273 |
+
color: #ffffff;
|
| 274 |
+
border: 1px solid #333333;
|
| 275 |
border-radius: 8px;
|
| 276 |
}
|
| 277 |
+
/* Style for dropdowns */
|
| 278 |
+
.stSelectbox > div > div > select {
|
| 279 |
+
background-color: #1a1a1a;
|
| 280 |
+
color: #ffffff;
|
| 281 |
+
border: 1px solid #333333;
|
| 282 |
+
border-radius: 8px;
|
| 283 |
+
}
|
| 284 |
+
/* Style for buttons */
|
| 285 |
.stButton > button {
|
| 286 |
+
background-color: #1f77b4;
|
| 287 |
+
color: #ffffff;
|
| 288 |
+
border-radius: 8px;
|
| 289 |
+
border: none;
|
| 290 |
+
padding: 10px 20px;
|
| 291 |
margin-left: auto;
|
| 292 |
margin-right: auto;
|
| 293 |
+
display: block;
|
| 294 |
+
}
|
| 295 |
+
.stDownloadButton > button {
|
| 296 |
background-color: #1f77b4;
|
| 297 |
color: #ffffff;
|
| 298 |
border-radius: 8px;
|
| 299 |
+
border: none;
|
| 300 |
+
padding: 10px 20px;
|
| 301 |
+
margin-left: auto;
|
| 302 |
+
margin-right: auto;
|
| 303 |
+
display: block;
|
| 304 |
}
|
| 305 |
+
/* Center audio player */
|
| 306 |
.stAudio {
|
| 307 |
display: flex;
|
| 308 |
justify-content: center;
|
| 309 |
}
|
| 310 |
+
/* Style text and labels */
|
| 311 |
+
h1, p, label, .stMarkdown, .stSpinner, .stError, .stWarning {
|
| 312 |
+
color: #ffffff !important;
|
| 313 |
+
text-align: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
}
|
| 315 |
+
/* Override sidebar and other Streamlit elements */
|
| 316 |
+
.st-emotion-cache-1r4v8oq, .st-emotion-cache-10trblm {
|
| 317 |
+
background-color: #000000 !important;
|
|
|
|
| 318 |
}
|
| 319 |
</style>
|
| 320 |
""", unsafe_allow_html=True)
|
|
|
|
| 327 |
return tmp_path
|
| 328 |
|
| 329 |
def main():
|
| 330 |
+
# Center the title and description with white text
|
| 331 |
st.markdown("<h1 style='text-align: center; color: #ffffff;'>Text-to-Speech Converter</h1>", unsafe_allow_html=True)
|
| 332 |
st.markdown("<p style='text-align: center; color: #ffffff;'>Enter text and select a language and voice to generate an MP3 audio file.</p>", unsafe_allow_html=True)
|
| 333 |
|