-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsoundworks.py
71 lines (48 loc) · 2.04 KB
/
soundworks.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- coding: utf-8 -*-
from playsound import playsound
from networktables import NetworkTables
import logging
logging.basicConfig(level=logging.DEBUG)
ip = "10.71.8.2"
NetworkTables.initialize(server=ip)
sd = NetworkTables.getTable("datatable")
sdFlagForInit = 0
sdFlagForBox = 0
sdFlagOnce = 0
sdFlagOnce1 = 0
queue = 0
while (True):
seconds = sd.getNumber('tyme', 0)
secondsList = list((str)(seconds))
if (len(secondsList) == 5):
firstDigit = secondsList[2]
secondDigit = secondsList[1]
thirdDigit = secondsList[0]
if (len(secondsList) == 4):
firstDigit = secondsList[1]
secondDigit = secondsList[0]
if (sdFlagForInit == 0):
playsound('C:/Users/mars/Desktop/pc-side/sounds/tr/hazir.mp3')
sdFlagForInit = 1
if (sd.getBoolean('tymeButton', False) == True):
print(secondsList)
if (len(secondsList) == 5):
playsound('sounds/tr/ucbasamakli/' + (str)(thirdDigit) + "00" + '.mp3')
if(secondDigit != 0):
playsound('sounds/tr/ikibasamakli/' + (str)(secondDigit) + "0" + '.mp3')
if(firstDigit == 0):
playsound('sounds/0.mp3')
elif():
playsound('sounds/tr/birbasamakli/' + (str)(firstDigit) + '.mp3')
playsound('sounds/tr/secondsLeft.mp3')
if (len(secondsList) == 4):
playsound('sounds/tr/ikibasamakli/' + (str)(secondDigit) + "0" + '.mp3')
if(firstDigit == 0):
playsound('sounds/0.mp3')
elif(0):
playsound('sounds/tr/birbasamakli/' + (str)(firstDigit) + '.mp3')
playsound('sounds/tr/secondsLeft.mp3')
sd.putBoolean('tymeButton', False)
if (sd.getString('roboState', "disabled") == "teleop" and sdFlagOnce == 0):
playsound('C:/Users/mars/Desktop/pc-side/sounds/tr/teleop.mp3')
sdFlagOnce += 1