Spaces:
Sleeping
Sleeping
antoniomae1234
commited on
Commit
β’
2e03983
1
Parent(s):
0153813
Upload 4 files
Browse files- README.md +13 -0
- app.py +41 -0
- gitattributes +35 -0
- requirements.txt +4 -0
README.md
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Edge TTS
|
3 |
+
emoji: ππ£οΈ
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: gray
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 4.19.2
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
license: openrail
|
11 |
+
---
|
12 |
+
|
13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import edge_tts
|
2 |
+
import gradio as gr
|
3 |
+
import tempfile
|
4 |
+
import anyio
|
5 |
+
|
6 |
+
|
7 |
+
language_dict = {
|
8 |
+
'English-Jenny (Female)': 'en-US-JennyNeural',
|
9 |
+
67 lindas mensagens de amor para namorado - Pensador
|
10 |
+
'Brazilian-Francisca- (Female)': 'pt-BR-FranciscaNeural',
|
11 |
+
'Brazilian-Antonio- (Male)': 'pt-BR-AntonioNeural',
|
12 |
+
'Brazilian-Antonio- (Male)': 'pt-BR-andrewNeural',
|
13 |
+
|
14 |
+
'Polish (Poland)-Zofia- (Female)': 'pl-PL-ZofiaNeural',
|
15 |
+
'Pashto (Afghanistan)-Gul Nawaz- (Male)': 'ps-AF-Gul',
|
16 |
+
}
|
17 |
+
|
18 |
+
async def text_to_speech_edge(text, language_code):
|
19 |
+
voice = language_dict.get(language_code, "default_voice")
|
20 |
+
communicate = edge_tts.Communicate(text, voice)
|
21 |
+
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
22 |
+
tmp_path = tmp_file.name
|
23 |
+
await communicate.save(tmp_path)
|
24 |
+
return f"Speech synthesis completed for: {text}", tmp_path
|
25 |
+
|
26 |
+
input_text = gr.Textbox(lines=5, label="Input Text")
|
27 |
+
output_text = gr.Textbox(label="Output Text")
|
28 |
+
output_audio = gr.Audio(type="filepath", label="Exported Audio")
|
29 |
+
language = gr.Dropdown(choices=list(language_dict.keys()), label="Choose the Voice Model")
|
30 |
+
|
31 |
+
interface = gr.Interface(
|
32 |
+
fn=text_to_speech_edge,
|
33 |
+
inputs=[input_text, language],
|
34 |
+
outputs=[output_text, output_audio],
|
35 |
+
title="Edge TTS",
|
36 |
+
description="Microsoft Edge Text-To-Speech (Forked & Fixed Ilaria TTS)",
|
37 |
+
|
38 |
+
)
|
39 |
+
|
40 |
+
if __name__ == "__main__":
|
41 |
+
anyio.run(interface.launch, backend="asyncio")
|
gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
edge-tts
|
2 |
+
audiosegment
|
3 |
+
scipy
|
4 |
+
librosa
|