Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,52 +11,16 @@ st.title("Text-to-Speech Translator with Kokoro")
|
|
| 11 |
# Expander section to display information in multiple languages
|
| 12 |
with st.expander("Sample Prompt!"):
|
| 13 |
st.markdown("""
|
| 14 |
-
|
| 15 |
-
- Mi nombre es Shukdev. (In Spanish)
|
| 16 |
-
- Je m'appelle Choukdev. (In French)
|
| 17 |
-
- मेरा नाम शुकदेव है. (In Hindi)
|
| 18 |
-
- Il mio nome è Shukdev. (In Italy)
|
| 19 |
-
- Meu nome é Sukhdev. (In Portuguese, Brazil)
|
| 20 |
-
- 我叫苏赫德夫。(In Chinese)
|
| 21 |
-
- 私の名前はスクデフです。(In Japanese)
|
| 22 |
""")
|
| 23 |
|
| 24 |
st.sidebar.markdown("""
|
| 25 |
-
### Courtesy: [Kokoro](https://huggingface.co/hexgrad/Kokoro-82M?fbclid=IwY2xjawIKqzxleHRuA2FlbQIxMAABHaf9GldgYOzXktNuoRtNKqd-aL7r-S7zPGyC8ttYOiG2zYfQqLyV4Qm75A_aem_0wKLC2C87ZZ2F04WjPJbtA)
|
| 26 |
""")
|
| 27 |
|
| 28 |
-
st.sidebar.header("
|
| 29 |
|
| 30 |
st.sidebar.markdown("""
|
| 31 |
-
|
| 32 |
-
1. **Enter Text**:
|
| 33 |
-
- Type or paste the text you want to convert to speech in the main text area.
|
| 34 |
-
|
| 35 |
-
2. **Select Language**:
|
| 36 |
-
- Choose the language of the input text. The available language options include:
|
| 37 |
-
- 🇺🇸 American English (`a`)
|
| 38 |
-
- 🇬🇧 British English (`b`)
|
| 39 |
-
- 🇪🇸 Spanish (`e`)
|
| 40 |
-
- 🇫🇷 French (`f`)
|
| 41 |
-
- 🇮🇳 Hindi (`h`)
|
| 42 |
-
- 🇮🇹 Italian (`i`)
|
| 43 |
-
- 🇧🇷 Brazilian Portuguese (`p`)
|
| 44 |
-
- 🇨🇳 Mandarin Chinese (`z`)
|
| 45 |
-
- 🇯🇵 Japanese (`j`)
|
| 46 |
-
3. **Select Voice**:
|
| 47 |
-
- Choose the voice you want for the speech. There are multiple voice styles based on tone and gender (e.g., af_heart, af_joy, etc.).
|
| 48 |
-
|
| 49 |
-
4. **Adjust Speech Speed**:
|
| 50 |
-
- Use the slider to adjust how fast the speech will be generated. The speed can be set from 0.5x to 2.0x, with 1.0x being the default normal speed.
|
| 51 |
-
5. **Generate Speech**:
|
| 52 |
-
- Once you've selected the text, language, voice, and speed, click the **"Generate Audio"** button. The app will process the text and generate the speech.
|
| 53 |
-
6. **Download Audio**:
|
| 54 |
-
- After the audio is generated, you can play it directly within the app or download it as a .wav file by clicking the **"Download Audio"** button.
|
| 55 |
-
### Additional Features:
|
| 56 |
-
- **Text Translation**:
|
| 57 |
-
- If you enter text in another language and want to hear it in English, provide your OpenAI API key (optional).
|
| 58 |
-
- The app will automatically translate the text to English and generate the speech in English with the voice you selected.
|
| 59 |
-
- Enjoy exploring different languages, voices, and speeds with the text-to-speech conversion!
|
| 60 |
""")
|
| 61 |
|
| 62 |
# User input for text, language, and voice settings
|
|
|
|
| 11 |
# Expander section to display information in multiple languages
|
| 12 |
with st.expander("Sample Prompt!"):
|
| 13 |
st.markdown("""
|
| 14 |
+
hi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
""")
|
| 16 |
|
| 17 |
st.sidebar.markdown("""
|
|
|
|
| 18 |
""")
|
| 19 |
|
| 20 |
+
st.sidebar.header("")
|
| 21 |
|
| 22 |
st.sidebar.markdown("""
|
| 23 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
""")
|
| 25 |
|
| 26 |
# User input for text, language, and voice settings
|