File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -887,17 +887,15 @@ def play_file(self, file_name):
887
887
if file_name .lower ().endswith (".wav" ):
888
888
with audiopwmio .PWMAudioOut (
889
889
board .SPEAKER
890
- ) as audio : # pylint: disable=not-callable
891
- with open (file_name , "rb" ) as audio_file :
890
+ ) as audio , open (file_name , "rb" ) as audio_file : # pylint: disable=not-callable
892
891
wavefile = audiocore .WaveFile (audio_file )
893
892
audio .play (wavefile )
894
893
while audio .playing :
895
894
pass
896
895
elif file_name .lower ().endswith (".mp3" ):
897
896
with audiopwmio .PWMAudioOut (
898
897
board .SPEAKER
899
- ) as audio : # pylint: disable=not-callable
900
- with open (file_name , "rb" ) as audio_file :
898
+ ) as audio , open (file_name , "rb" ) as audio_file : # pylint: disable=not-callable
901
899
mp3file = audiomp3 .MP3Decoder (audio_file )
902
900
audio .play (mp3file )
903
901
while audio .playing :
You can’t perform that action at this time.
0 commit comments