Spaces:
Sleeping
Sleeping
Hugo Rodrigues
commited on
Commit
•
8a561f6
1
Parent(s):
45cbd78
audio generate different files
Browse files
main.py
CHANGED
@@ -87,7 +87,9 @@ async def audio(inputs, src_lang="eng", tgt_lang="por", speaker_id=5):
|
|
87 |
print("Time took to process the request and return response is {} sec".format(
|
88 |
time.time() - start_time))
|
89 |
|
90 |
-
|
|
|
|
|
91 |
audio_array_from_text)
|
92 |
|
93 |
-
return FileResponse(
|
|
|
87 |
print("Time took to process the request and return response is {} sec".format(
|
88 |
time.time() - start_time))
|
89 |
|
90 |
+
print(f"sampling_rate {model.config.sampling_rate}")
|
91 |
+
|
92 |
+
write(f"/tmp/output{start_time}.wav", model.config.sampling_rate,
|
93 |
audio_array_from_text)
|
94 |
|
95 |
+
return FileResponse(f"/tmp/output{start_time}.wav", media_type="audio/mpeg")
|