HOTFIX play_sound function

This commit is contained in:
Ninnjah 2020-10-20 23:41:25 +03:00 committed by GitHub
parent 2462b3f8a1
commit 9971375008
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,12 +127,17 @@ 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)