richardorama commited on
Commit
ad5d8ab
·
verified ·
1 Parent(s): af15c16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -154,12 +154,13 @@ if STATEMENT:
154
  audio_data = speech['waveform']
155
 
156
  # Optional: Save the audio to a file (uncomment if needed)
157
- # sd.write(audio_data, samplerate=speech['sampling_rate']) # Adjust samplerate if necessary
158
- # with open("sample_tts.wav", "wb") as f:
159
- # f.write(audio_data)
160
 
161
  # Optional: Play the audio directly in Streamlit (uncomment if needed)
162
- sd.play(audio_data, samplerate=speech['sampling_rate']) # Adjust samplerate if necessary
 
163
 
164
  st.sidebar.write('Text converted to speech')
165
  else:
 
154
  audio_data = speech['waveform']
155
 
156
  # Optional: Save the audio to a file (uncomment if needed)
157
+ sd.write(audio_data, samplerate=speech['sampling_rate']) # Adjust samplerate if necessary
158
+ with open("sample_tts.wav", "wb") as f:
159
+ f.write(audio_data)
160
 
161
  # Optional: Play the audio directly in Streamlit (uncomment if needed)
162
+ # Huggingface does not have direct access to the generated audio data
163
+ # sd.play(audio_data, samplerate=speech['sampling_rate']) # Adjust samplerate if necessary
164
 
165
  st.sidebar.write('Text converted to speech')
166
  else: