From cc058a907b6d49a4f0b1ef496369eb386764aa9a Mon Sep 17 00:00:00 2001 From: John Edgar Park Date: Fri, 14 Sep 2018 12:03:32 -0700 Subject: [PATCH] added line to close wave file after playback --- Milk_Jug_Glow_Skull/milk_jug_glow_skull.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Milk_Jug_Glow_Skull/milk_jug_glow_skull.py b/Milk_Jug_Glow_Skull/milk_jug_glow_skull.py index 3cbbf818..9f2ab3bf 100644 --- a/Milk_Jug_Glow_Skull/milk_jug_glow_skull.py +++ b/Milk_Jug_Glow_Skull/milk_jug_glow_skull.py @@ -47,12 +47,12 @@ def blink(times, speed): time.sleep(speed) def play_waves(file_num): - wave_file = open(wave_files[file_num], "rb") + wave_file = open(wave_files[file_num], "rb") # open a wav file wave = audioio.WaveFile(wave_file) - audio.play(wave) - while audio.playing: + audio.play(wave) # play the wave file + while audio.playing: # allow the wav to finish playing pass - + wave_file.close() # close the wav file wave_files = ["alex_deepgrowl1.wav", "alex-highgrowl1.wav", "alex-squeal1.wav", "toni-deepgrowl.wav", "toni-highgrowl2.wav","toni-pigsqueal.wav",