HOTFIX play_sound function
This commit is contained in:
parent
2462b3f8a1
commit
9971375008
1 changed files with 14 additions and 9 deletions
23
main.py
23
main.py
|
@ -127,19 +127,24 @@ def save(): # Сохранение списка
|
|||
hotkeys = None
|
||||
|
||||
def play_sound(index): # Проигрываение звука
|
||||
print(select[0], select[1])
|
||||
try:
|
||||
filename = COMBOS[index].currentText()
|
||||
try:
|
||||
data, fs = sf.read(os.path.join('sound', filename), dtype='float32')
|
||||
sd.play(data, fs)
|
||||
keyboard.wait(sd.play())
|
||||
sd.wait()
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
filename = menu[select[0]][select[1]]
|
||||
print(filename)
|
||||
try:
|
||||
data, fs = sf.read(os.path.join(menu[select[0]][0], filename), dtype='float32')
|
||||
sd.play(data, fs)
|
||||
keyboard.wait(sd.play())
|
||||
sd.wait()
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
data, fs = sf.read(os.path.join(menu[select[0]][0], filename), dtype='float32')
|
||||
sd.play(data, fs)
|
||||
keyboard.wait(sd.play())
|
||||
sd.wait()
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
###! CONTROL !###
|
||||
|
|
Loading…
Add table
Reference in a new issue