Update app.py
Browse files
app.py
CHANGED
|
@@ -143,13 +143,15 @@ STATEMENT = st.sidebar.text_area('Enter Text', DEFAULT_STATEMENT, height=150)
|
|
| 143 |
|
| 144 |
# Enable the button only if there is text in the TTS variable
|
| 145 |
if STATEMENT:
|
| 146 |
-
if st.sidebar.button('
|
| 147 |
# Text to generate speech from
|
| 148 |
text = STATEMENT # Use the user input from STATEMENT
|
| 149 |
|
| 150 |
# Generate speech
|
| 151 |
speech = tts(text)
|
| 152 |
-
|
|
|
|
|
|
|
| 153 |
# Access the audio waveform from the dictionary (assuming key name is 'waveform')
|
| 154 |
audio_data = speech['waveform']
|
| 155 |
|
|
@@ -164,7 +166,7 @@ if STATEMENT:
|
|
| 164 |
|
| 165 |
st.sidebar.write('Text converted to speech')
|
| 166 |
else:
|
| 167 |
-
st.sidebar.button('
|
| 168 |
# st.warning(' Please enter Statement!')
|
| 169 |
|
| 170 |
|
|
|
|
| 143 |
|
| 144 |
# Enable the button only if there is text in the TTS variable
|
| 145 |
if STATEMENT:
|
| 146 |
+
if st.sidebar.button('Convert Text to Speech'):
|
| 147 |
# Text to generate speech from
|
| 148 |
text = STATEMENT # Use the user input from STATEMENT
|
| 149 |
|
| 150 |
# Generate speech
|
| 151 |
speech = tts(text)
|
| 152 |
+
|
| 153 |
+
st.sidebar.write(speech.keys())
|
| 154 |
+
|
| 155 |
# Access the audio waveform from the dictionary (assuming key name is 'waveform')
|
| 156 |
audio_data = speech['waveform']
|
| 157 |
|
|
|
|
| 166 |
|
| 167 |
st.sidebar.write('Text converted to speech')
|
| 168 |
else:
|
| 169 |
+
st.sidebar.button('Convert Text to Speech', disabled=True)
|
| 170 |
# st.warning(' Please enter Statement!')
|
| 171 |
|
| 172 |
|