Spaces:
Running
on
Zero
Running
on
Zero
audio Concat
Browse files
README.md
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
---
|
2 |
title: Podcastify
|
3 |
sdk: gradio
|
|
|
|
|
4 |
emoji: 🗣️
|
5 |
license: mit
|
6 |
app_file: app.py
|
|
|
7 |
pinned: true
|
8 |
short_description: Turn Any Article to Podcast
|
9 |
---
|
|
|
1 |
---
|
2 |
title: Podcastify
|
3 |
sdk: gradio
|
4 |
+
colorFrom: purple
|
5 |
+
colorTo: blue
|
6 |
emoji: 🗣️
|
7 |
license: mit
|
8 |
app_file: app.py
|
9 |
+
header: mini
|
10 |
pinned: true
|
11 |
short_description: Turn Any Article to Podcast
|
12 |
---
|
app.py
CHANGED
@@ -15,7 +15,7 @@ def synthesize(conversation_text, speed, progress=gr.Progress()):
|
|
15 |
'EN': TTS(language='EN', device=device),
|
16 |
}
|
17 |
speakers = ['EN-US', 'EN-Default']
|
18 |
-
|
19 |
|
20 |
conversation = json.loads(conversation_text)
|
21 |
for i, turn in enumerate(conversation["conversation"]):
|
@@ -23,13 +23,9 @@ def synthesize(conversation_text, speed, progress=gr.Progress()):
|
|
23 |
text = turn["text"]
|
24 |
speaker = speakers[i % 2]
|
25 |
speaker_id = models['EN'].hps.data.spk2id[speaker]
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
bio.seek(0)
|
30 |
-
final_bio.write(bio.read())
|
31 |
-
|
32 |
-
final_bio.seek(0)
|
33 |
return final_bio.getvalue()
|
34 |
|
35 |
with gr.Blocks() as demo:
|
|
|
15 |
'EN': TTS(language='EN', device=device),
|
16 |
}
|
17 |
speakers = ['EN-US', 'EN-Default']
|
18 |
+
final_audio = io.BytesIO()
|
19 |
|
20 |
conversation = json.loads(conversation_text)
|
21 |
for i, turn in enumerate(conversation["conversation"]):
|
|
|
23 |
text = turn["text"]
|
24 |
speaker = speakers[i % 2]
|
25 |
speaker_id = models['EN'].hps.data.spk2id[speaker]
|
26 |
+
models['EN'].tts_to_file(text, speaker_id, bio, speed=speed, pbar=progress.tqdm, format='wav')
|
27 |
+
final_audio.write(bio.getvalue())
|
28 |
+
|
|
|
|
|
|
|
|
|
29 |
return final_bio.getvalue()
|
30 |
|
31 |
with gr.Blocks() as demo:
|