code.py
 1  # SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
 2  #
 3  # SPDX-License-Identifier: MIT
 4  
 5  import audiocore
 6  import board
 7  import audiobusio
 8  
 9  wave_file = open("StreetChicken.wav", "rb")
10  wave = audiocore.WaveFile(wave_file)
11  
12  # For Feather M0 Express, ItsyBitsy M0 Express, Metro M0 Express
13  audio = audiobusio.I2SOut(board.D1, board.D0, board.D9)
14  # For Feather M4 Express
15  # audio = audiobusio.I2SOut(board.D1, board.D10, board.D11)
16  # For Metro M4 Express
17  # audio = audiobusio.I2SOut(board.D3, board.D9, board.D8)
18  
19  while True:
20      audio.play(wave)
21      while audio.playing:
22          pass