Adafruit_Learning_System_Gu.../Adafruit_MAX98357/CircuitPython_I2S_Wave.py
2018-07-19 18:07:28 -04:00

18 lines
486 B
Python
Executable file

import audioio
import board
import audiobusio
wave_file = open("StreetChicken.wav", "rb")
wave = audioio.WaveFile(wave_file)
# For Feather M0 Express, ItsyBitsy M0 Express, Metro M0 Express
audio = audiobusio.I2SOut(board.D1, board.D0, board.D9)
# For Feather M4 Express
# audio = audiobusio.I2SOut(board.D1, board.D10, board.D11)
# For Metro M4 Express
# audio = audiobusio.I2SOut(board.D3, board.D9, board.D8)
while True:
audio.play(wave)
while audio.playing:
pass