code.py
 1  # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
 2  #
 3  # SPDX-License-Identifier: MIT
 4  
 5  """
 6  CircuitPython I2S WAV file playback.
 7  Plays a WAV file once.
 8  """
 9  import audiocore
10  import board
11  import audiobusio
12  
13  audio = audiobusio.I2SOut(board.GP0, board.GP1, board.GP2)
14  
15  wave_file = open("StreetChicken.wav", "rb")
16  wav = audiocore.WaveFile(wave_file)
17  
18  print("Playing wav file!")
19  audio.play(wav)
20  while audio.playing:
21      pass
22  print("Done!")