MicroPython Cookbook
上QQ阅读APP看书,第一时间看更新

How to do it...

Let's perform the following steps:

  1. Copy the hello.wav file to the device in the same folder as the main.py file. Then, run the following lines of code in the REPL:
>>> from adafruit_circuitplayground.express import cpx
>>> cpx.play_file('hello.wav')
  1. You should hear the board say "Hello" as it plays back the audio file.