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