Fix for exception due to missing buzzer.wav
This commit is contained in:
parent
cbdf10075e
commit
38669acc44
@ -15,6 +15,8 @@ def doBuzz():
|
||||
winsound.PlaySound(buzzPath, winsound.SND_FILENAME|winsound.SND_ASYNC)
|
||||
elif(alsaaudio):
|
||||
buzzPath = utils.findWorkingDir() + "/resources/buzzer.wav"
|
||||
print buzzPath
|
||||
try:
|
||||
buzz = wave.open(buzzPath, 'rb')
|
||||
device = alsaaudio.PCM(0)
|
||||
device.setchannels(buzz.getnchannels())
|
||||
@ -31,5 +33,6 @@ def doBuzz():
|
||||
device.write(data)
|
||||
data = buzz.readframes(640)
|
||||
buzz.close()
|
||||
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user