Spaces:
Runtime error
Runtime error
Commit
·
1b59e3b
1
Parent(s):
23742ac
update tts
Browse files
app.py
CHANGED
@@ -107,11 +107,14 @@ def text_to_speech_loc(text):
|
|
107 |
model="microsoft/speecht5_tts",
|
108 |
device=device,
|
109 |
)
|
110 |
-
|
|
|
|
|
111 |
print("Type of speech: ", type(speech))
|
|
|
112 |
|
113 |
timestr = time.strftime("%Y%m%d-%H%M%S")
|
114 |
-
sampling_rate = 16000
|
115 |
with open('sample-' + timestr + '.wav', 'wb') as audio:
|
116 |
wavfile.write(audio, sampling_rate, speech)
|
117 |
# audio = sf.write("convert1.wav", speech, samplerate=16000)
|
|
|
107 |
model="microsoft/speecht5_tts",
|
108 |
device=device,
|
109 |
)
|
110 |
+
output = pipe(text)
|
111 |
+
speech = output["audio"]
|
112 |
+
sampling_rate = output["sampling_rate"]
|
113 |
print("Type of speech: ", type(speech))
|
114 |
+
print("sampling_rate: ", sampling_rate)
|
115 |
|
116 |
timestr = time.strftime("%Y%m%d-%H%M%S")
|
117 |
+
# sampling_rate = 16000
|
118 |
with open('sample-' + timestr + '.wav', 'wb') as audio:
|
119 |
wavfile.write(audio, sampling_rate, speech)
|
120 |
# audio = sf.write("convert1.wav", speech, samplerate=16000)
|