Skip to content

Commit 84e4259

Browse files
committed
Formatted per pre-commit
1 parent 0314486 commit 84e4259

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

adafruit_macropad.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -885,21 +885,21 @@ def play_file(self, file_name):
885885
self.stop_tone()
886886
self._speaker_enable.value = True
887887
if file_name.lower().endswith(".wav"):
888-
with audiopwmio.PWMAudioOut(
889-
board.SPEAKER
890-
) as audio, open(file_name, "rb") as audio_file: # pylint: disable=not-callable
891-
wavefile = audiocore.WaveFile(audio_file)
892-
audio.play(wavefile)
893-
while audio.playing:
894-
pass
888+
with audiopwmio.PWMAudioOut(board.SPEAKER) as audio, open(
889+
file_name, "rb"
890+
) as audio_file: # pylint: disable=not-callable
891+
wavefile = audiocore.WaveFile(audio_file)
892+
audio.play(wavefile)
893+
while audio.playing:
894+
pass
895895
elif file_name.lower().endswith(".mp3"):
896-
with audiopwmio.PWMAudioOut(
897-
board.SPEAKER
898-
) as audio, open(file_name, "rb") as audio_file: # pylint: disable=not-callable
899-
mp3file = audiomp3.MP3Decoder(audio_file)
900-
audio.play(mp3file)
901-
while audio.playing:
902-
pass
896+
with audiopwmio.PWMAudioOut(board.SPEAKER) as audio, open(
897+
file_name, "rb"
898+
) as audio_file: # pylint: disable=not-callable
899+
mp3file = audiomp3.MP3Decoder(audio_file)
900+
audio.play(mp3file)
901+
while audio.playing:
902+
pass
903903
else:
904904
raise ValueError("Filetype must be wav or MP3.")
905905
self._speaker_enable.value = False

0 commit comments

Comments
 (0)