Amazigh-tts / app.py
Mohamed Aymane Farhi
Add Tachelhit (shi).
538fed7
raw
history blame
1.21 kB
# -*- coding: utf-8 -*-
from ttsmms import TTS
import gradio as gr
tts = TTS("shi")
def generate_voice(text):
audio = tts.synthesis(text)
return (audio['sampling_rate'], audio['x'])
with gr.Blocks(title="Tachelhit Text to Speech with MMS") as blocks:
gr.Markdown('# Tashelhit Text to Speech - MMS')
gr.Markdown('MMS: Scaling Speech Technology to 1000+ languages by Meta AI')
input_text = gr.Textbox(label="Input Text", lines=3)
#examples = gr.Examples(examples=["αž“αŸαŸ‡β€‹αž‡αžΆβ€‹αžšαžΌαž”αžαžβ€‹αž‡αž“αžŸαž„αŸ’αžŸαŸαž™β€‹αžŠαŸ‚αž›β€‹αž”αŸαžΈαž€αž‘αžΆαž“αŸ”", "αž—αŸ’αž“αŸ†αž–αŸ’αžšαŸ‡ αž¬αžαŸ’αž“αž„αž–αŸ’αžšαŸ‡ αž‡αžΆαžαŸ†αž”αž“αŸ‹αž’αŸαž€αžΌαžšαž‘αŸαžŸαž…αžšαžŽαŸαž’αž˜αŸ’αž˜αž‡αžΆαžαž·αžŠαŸαž‘αžΆαž€αŸ‹αž‘αžΆαž‰αž˜αž½αž™αž€αŸ’αž“αž»αž„αž–αŸαž›αž”αž…αŸ’αž…αž»αž”αŸ’αž”αž“αŸ’αž“αŸ”"], inputs=[input_text])
run_button = gr.Button(value="Run")
out_audio = gr.Audio(
label="Output Audio",
type="numpy",
)
inputs = [input_text]
outputs = [out_audio]
run_button.click(
fn=generate_voice,
inputs=inputs,
outputs=outputs,
queue=True,
)
blocks.queue(concurrency_count=1).launch(debug=True)