Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import soundfile as sf
|
|
5 |
import io
|
6 |
|
7 |
# Streamlit App UI Setup
|
8 |
-
st.title("Text-to-Speech with Kokoro")
|
9 |
|
10 |
# Expander section to display information in multiple languages
|
11 |
with st.expander("Sample Prompt!"):
|
@@ -22,34 +22,40 @@ with st.expander("Sample Prompt!"):
|
|
22 |
|
23 |
st.sidebar.header("Configuration & Instructions")
|
24 |
|
25 |
-
# Sidebar Instructions
|
26 |
st.sidebar.markdown("""
|
27 |
### How to Use the Text-to-Speech App:
|
28 |
-
1. **Enter Text**:
|
29 |
-
|
30 |
-
2. **Select Language**:
|
31 |
-
- Choose the language of the text you are entering. Available options include:
|
32 |
-
- ๐บ๐ธ American English (`a`)
|
33 |
-
- ๐ฌ๐ง British English (`b`)
|
34 |
-
- ๐ช๐ธ Spanish (`e`)
|
35 |
-
- ๐ซ๐ท French (`f`)
|
36 |
-
- ๐ฎ๐ณ Hindi (`h`)
|
37 |
-
- ๐ฎ๐น Italian (`i`)
|
38 |
-
- ๐ง๐ท Brazilian Portuguese (`p`)
|
39 |
-
- ๐จ๐ณ Mandarin Chinese (`z`)
|
40 |
-
- ๐ฏ๐ต Japanese (`j`)
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
3. **Select Voice**:
|
43 |
-
- Choose the voice
|
44 |
|
45 |
-
4. **Adjust Speed**:
|
46 |
-
- Use the
|
|
|
47 |
5. **Generate Speech**:
|
48 |
-
-
|
49 |
-
|
50 |
-
6. **Download**:
|
51 |
-
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
53 |
""")
|
54 |
|
55 |
# User input for text, language, and voice settings
|
|
|
5 |
import io
|
6 |
|
7 |
# Streamlit App UI Setup
|
8 |
+
st.title("Text-to-Speech Translator with Kokoro")
|
9 |
|
10 |
# Expander section to display information in multiple languages
|
11 |
with st.expander("Sample Prompt!"):
|
|
|
22 |
|
23 |
st.sidebar.header("Configuration & Instructions")
|
24 |
|
|
|
25 |
st.sidebar.markdown("""
|
26 |
### How to Use the Text-to-Speech App:
|
27 |
+
1. **Enter Text**:
|
28 |
+
- Type or paste the text you want to convert to speech in the main text area.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
+
2. **Select Language**:
|
31 |
+
- Choose the language of the input text. The available language options include:
|
32 |
+
- ๐บ๐ธ **English** (American English)
|
33 |
+
- ๐ฌ๐ง **British English**
|
34 |
+
- ๐ช๐ธ **Spanish**
|
35 |
+
- ๐ซ๐ท **French**
|
36 |
+
- ๐ฎ๐ณ **Hindi**
|
37 |
+
- ๐ฎ๐น **Italian**
|
38 |
+
- ๐ง๐ท **Portuguese** (Brazilian)
|
39 |
+
- ๐จ๐ณ **Chinese** (Mandarin)
|
40 |
+
- ๐ฏ๐ต **Japanese**
|
41 |
+
|
42 |
3. **Select Voice**:
|
43 |
+
- 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.).
|
44 |
|
45 |
+
4. **Adjust Speech Speed**:
|
46 |
+
- 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.
|
47 |
+
|
48 |
5. **Generate Speech**:
|
49 |
+
- 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.
|
50 |
+
|
51 |
+
6. **Download Audio**:
|
52 |
+
- 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.
|
53 |
+
|
54 |
+
### Additional Features:
|
55 |
+
- **Text Translation**:
|
56 |
+
- The app can automatically translate the text to English before generating audio. After the translation, you will hear the audio in English with your chosen voice.
|
57 |
+
|
58 |
+
Enjoy exploring different languages, voices, and speeds with the text-to-speech conversion!
|
59 |
""")
|
60 |
|
61 |
# User input for text, language, and voice settings
|