-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday26_100.py
31 lines (29 loc) · 838 Bytes
/
day26_100.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from replit import audio
import os, time
def play():
source = audio.play_file('audio.wav')
source.paused = False # unpause the playback
while True:
stop_playback = int(input("Press 2 anytime to stop playback and go back to the menu : ")) # giving the user the option to stop playback
if stop_playback == 2:
source.paused = True # let's pause the file
return # let's go back from this play() subroutine
else:
continue
while True:
os.system("clear")
print("🎵 MyPOD Music Player ")
time.sleep(1)
print("Press 1 to Play")
time.sleep(1)
print("Press 2 to Exit")
time.sleep(1)
print("Press anything else to see the menu again")
userInput = int(input())
if userInput == 1:
print("Playing some proper tunes!")
play()
elif userInput == 2:
exit()
else :
continue