Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
esh-g authored Jan 10, 2021
1 parent 87c21d5 commit 6544a8c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Tambola2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import random
from gtts import gTTS
import vlc
from time import sleep
import keyboard as kb

def play(name, filename):
word = gTTS(str(name), lang = 'en', slow = False)
word.save(filename)
p = vlc.MediaPlayer(filename)
p.play()

a = random.randint(1, 90)
lst = []
speed = 2
for _ in range(90):
n = 0
while a in lst:
a = random.randint(1,90)
print(a)
play(a, 'Hello.mp3')
lst.append(a)
while n <= speed:
n += 0.01
sleep(0.01)
if kb.is_pressed('space'):
print('paused')
play('paused', 'Hello.mp3')
temp = input('Enter a num to change speed or type exit to quit. ')
if temp.strip() == 'exit':
exit()
elif len(temp.strip()) == 0:
continue
elif len(temp.strip()) != 0:
try:
speed = int(temp)
except ValueError:
print('Enter only a number, dum-dum')

0 comments on commit 6544a8c

Please sign in to comment.