Skip to content

Commit 13c4623

Browse files
committed
Added deinit() to play_file, stop_tone
1 parent 862a379 commit 13c4623

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

adafruit_circuitplayground/express.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@ def stop_tone(self):
649649
# Stop playing any tones.
650650
if self._sample is not None and self._sample.playing:
651651
self._sample.stop()
652+
self._sample.deinit()
653+
self._sample = None
652654
self._speaker_enable.value = False
653655

654656
def play_file(self, file_name):
@@ -677,6 +679,7 @@ def play_file(self, file_name):
677679
audio.play(file)
678680
while audio.playing:
679681
pass
682+
audio.deinit()
680683
else:
681684
audio = audioio.AudioOut(board.SPEAKER, open(file_name, "rb"))
682685
audio.play()

0 commit comments

Comments
 (0)