User Manual

This is one of the
few
outputs that does not go through the seesaw chip. Instead, the audio is played directly from the
CircuitPython board and the Crickit only amplifies it!
Audio File Formats
CircuitPython supports Mono (not stereo) 22 KHz sample rate (or less) and 16-bit WAV format. The reason for mono is
that there's only one output, 22 KHz or less because the Circuit Playground can't handle more data than that (and also
it wont sound much better) and the DAC output is 10-bit so anything over 16-bit will just take up room without better
quality
CircuitPython does not support OGG or MP3. Just WAV!
Since the WAV file must fit on the CircuitPython file system, it must be under 2 MB
We have a detailed guide on how to generate WAV files here (https://adafru.it/s8f)
Amplifier Details
The onboard amplifier is a mono "Class D" audio amp with BTL (Bridge Tied Load) output.
That means you cannot plug the speaker output into another amplifier, it must connect directly to a speaker!
You can use just about
any
4 to 8Ω speaker (6 Ω is OK too, just not as common). The amplifier can drive up to 3 Watts
into 4Ω and 1 Watt into 8Ω. That means its ok to drive a 5 Watt speaker, it just wont be as loud as it
could
be with a
bigger amp (but you wont damage the amp). You can also drive speakers that are smaller, like an 8Ω 0.5 W but make
sure you don't turn the audio volume potentiometer up, as it could damage the speaker by overpowering it.
Basic Audio Playback
Here is the audio file we're using for this example
https://adafru.it/Be4
https://adafru.it/Be4
import audioio
import board
wavfile = "howto.wav"
f = open(wavfile, "rb")
wav = audioio.WaveFile(f)
a = audioio.AudioOut(board.A0)
a.play(wav)
# You can now do all sorts of stuff here while the audio plays
# such as move servos, motors, read sensors...
# Or wait for the audio to finish playing:
while a.playing:
pass
f.close()
© Adafruit Industries
https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-
construction-kit
Page 115 of 201