Play a WAV file on the Pico

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
dmccreary
Posts: 1
Joined: Sun Feb 21, 2021 2:10 am

Play a WAV file on the Pico

Post by dmccreary » Sat Oct 23, 2021 2:16 pm

Hi everyone,

I am working on a CoderDojo project for students using the Raspberry Pi Pico. Our Cylon Pumpkin needs to play some sounds and say a few short phrases when motion is detected.

I have an SD card reader working on the Raspberry Pi Pico but I can't seem to find out how to play a WAV file using a PWM output. I don't need high-fidelity, just enough to play simple robot sounds like the Cylon robot sound for a Cylon pumpkin.

https://vulpa.tripod.com/cylons/cylon_snds.html

Will the I2S software work on the Pico with just a PWM output?

I have been reading this github site about i2S support in MicroPython:

https://github.com/miketeachman/micropy ... s-examples

Our student project (the Cylon Pumpkin) is here:

https://www.coderdojotc.org/micropython ... /01-intro/

Thanks! - Dan

User avatar
Mike Teachman
Posts: 155
Joined: Mon Jun 13, 2016 3:19 pm
Location: Victoria, BC, Canada

Re: Play a WAV file on the Pico

Post by Mike Teachman » Sun Oct 24, 2021 3:53 am

What a fun project !
dmccreary wrote:
Sat Oct 23, 2021 2:16 pm
Will the I2S software work on the Pico with just a PWM output?
Unfortunately not. The I2S feature requires hardware that supports the I2S protocol. For producing sounds, you could use a product like the Adafruit I2S 3W breakout board. Pico firmware with the I2S feature is available here

Post Reply