Spaces:
Sleeping
Sleeping
Chandrabhan01
commited on
Commit
·
0aaf2f9
1
Parent(s):
ea652b8
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
from gtts import gTTS
|
2 |
import gradio as gr
|
3 |
-
|
4 |
|
5 |
lang = {'Afrikaans': 'af','Arabic':'ar','Bulgarian':'bg','Bengali':'bn','Bosnian':'bs',
|
6 |
'Catalan':'ca','Czech':'cs','Danish':'da','German':'de','Greek':'el','English':'en',
|
@@ -23,9 +23,8 @@ tld = {'English(Australia)':'com.au', 'English (United Kingdom)':'co.uk',
|
|
23 |
'Spanish (Mexico)':'com.mx','Spanish (Spain)':'es','Spanish (United States)':'us'}
|
24 |
|
25 |
def T2TConversion(sentence, language):
|
26 |
-
|
27 |
-
|
28 |
-
return translation.text
|
29 |
|
30 |
def convert_text(Text, Accent):
|
31 |
""" Performs Text-To-Speech provided language and accent.] """
|
|
|
1 |
from gtts import gTTS
|
2 |
import gradio as gr
|
3 |
+
import mtranslate
|
4 |
|
5 |
lang = {'Afrikaans': 'af','Arabic':'ar','Bulgarian':'bg','Bengali':'bn','Bosnian':'bs',
|
6 |
'Catalan':'ca','Czech':'cs','Danish':'da','German':'de','Greek':'el','English':'en',
|
|
|
23 |
'Spanish (Mexico)':'com.mx','Spanish (Spain)':'es','Spanish (United States)':'us'}
|
24 |
|
25 |
def T2TConversion(sentence, language):
|
26 |
+
translated_text = mtranslate.translate(sentence, lang[language])
|
27 |
+
return translated_text
|
|
|
28 |
|
29 |
def convert_text(Text, Accent):
|
30 |
""" Performs Text-To-Speech provided language and accent.] """
|