Closed joebaird closed 2 years ago
thanks for the pointer! Ran pre-commit and fixed the whitespace issue.
Good call, doesn't look like calling audio.stop() would cause any problems if nothing is playing, so adding it to the stop_play is a good addition.
The play_file function added the ability to be non-blocking, but there is no call to stop audio playback and turn the speaker back off. This change adds a stop_play function that closes the wavfile and turns the speaker back off. This change required the wavfile variable to a class variable to allow access in the stop_play function.