Answer the question
In order to leave comments, you need to log in
Why does gTTS give an error in Kivy?
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.progressbar import ProgressBar
from kivy.graphics.transformation import Matrix
from kivy.animation import Animation
from gtts import gTTS
class Container(BoxLayout):
def Converting(self):
One = str(self.text_1.text)
Two = str(self.text_2.text)
tts1 = gTTS(One)
tts2 = gTTS(Two)
final_tts = (tts1, tts2)
tts1.save('Hello.mp3')
class MyApp(App):
def build(self):
return Container()
if __name__ == "__main__":
MyApp().run()
<Container>:
button:Convert_Button
text_1: Text_Input_1
text_2: Text_Input_2
text_3: Text_Input_3
BoxLayout:
Button:
`
font_size: 20
size_hint: 1, 0.1
pos_hint: {'center.x':1, 'y': 0}
id: Convert_Button
text: 'Конвертирование'
on_release:
root.Converting()
TextInput:
size_hint: 0.1, 0.1
pos_hint: {'center.x':-1, 'center.y':1}
id: Text_Input_1
TextInput:
size_hint: 0.1, 0.1
pos_hint: {'x':-1, 'center.y':-1 }
id: Text_Input_2
TextInput:
size_hint: 0.3, 0.2
pos_hint: {'x':-1, 'center.y':-1 }
id: Text_Input_3
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question