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
|
hotkeys = None
|
||||||
|
|
||||||
def play_sound(index): # Проигрываение звука
|
def play_sound(index): # Проигрываение звука
|
||||||
print(select[0], select[1])
|
|
||||||
try:
|
try:
|
||||||
filename = COMBOS[index].currentText()
|
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:
|
except:
|
||||||
filename = menu[select[0]][select[1]]
|
filename = menu[select[0]][select[1]]
|
||||||
print(filename)
|
try:
|
||||||
try:
|
data, fs = sf.read(os.path.join(menu[select[0]][0], filename), dtype='float32')
|
||||||
data, fs = sf.read(os.path.join(menu[select[0]][0], filename), dtype='float32')
|
sd.play(data, fs)
|
||||||
sd.play(data, fs)
|
keyboard.wait(sd.play())
|
||||||
keyboard.wait(sd.play())
|
sd.wait()
|
||||||
sd.wait()
|
except:
|
||||||
except:
|
pass
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
###! CONTROL !###
|
###! CONTROL !###
|
||||||
|
|
Loading…
Add table
Reference in a new issue