_summary_: Greet the user with using Audio
(self)
| 215 | # exit() # Some how I need to exit it |
| 216 | |
| 217 | def greeting(self): |
| 218 | """_summary_: Greet the user with using Audio""" |
| 219 | text_to_audio = "Welcome To The Calculator" |
| 220 | self.gtts_object = gTTS(text=text_to_audio, lang="en", tld="co.in", slow=False) |
| 221 | tts = self.gtts_object |
| 222 | fp = BytesIO() |
| 223 | tts.write_to_fp(fp) |
| 224 | fp.seek(0) # Reset the BytesIO object to the beginning |
| 225 | mixer.init() |
| 226 | mixer.music.load(fp) |
| 227 | mixer.music.play() |
| 228 | while mixer.music.get_busy(): |
| 229 | time.Clock().tick(10) |
| 230 | |
| 231 | # Here OOP is not followed. |
| 232 | def user_name(self): |