Circuit Playground Arduino wav file

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Lisa_M
 
Posts: 10
Joined: Mon Dec 17, 2018 2:56 pm

Circuit Playground Arduino wav file

Post by Lisa_M »

Hi folks,

I'm trying to find a guide for how to play a .wav file while coding Circuit Playground with arduino. I'm not having any luck. Everything keeps pointing me to Circuit Python - which i'm currently not using with my students.

Anyone have a helpful link?

Thanks

User avatar
Lisa_M
 
Posts: 10
Joined: Mon Dec 17, 2018 2:56 pm

Re: Circuit Playground Arduino wav file

Post by Lisa_M »

I should add that we picked up some STEMMA speakers too. There are makecode and circuit python projects ...but nothing in arduino that I can find.

User avatar
danhalbert
 
Posts: 4650
Joined: Tue Aug 08, 2017 12:37 pm

Re: Circuit Playground Arduino wav file

Post by danhalbert »

I'm assuming these are Circuit Playground Express boards, not Circuit Playground Classic (it says on the back). Is that right?

You can use the ArduinoZero library, which plays audio on SAMD21-based boards: https://www.arduino.cc/reference/en/lib ... audiozero/

User avatar
Lisa_M
 
Posts: 10
Joined: Mon Dec 17, 2018 2:56 pm

Re: Circuit Playground Arduino wav file

Post by Lisa_M »

We are using a mix of Circuit Playground and Circuit Playground Express because I do not have a full class set of Express.

It's nice to know there is an audio library for the SAMD board.

I'm pretty new to Arduino though so I'm also hoping for some sample code or a tutorial so I can see the code in action.

Thank you.

User avatar
danhalbert
 
Posts: 4650
Joined: Tue Aug 08, 2017 12:37 pm

Re: Circuit Playground Arduino wav file

Post by danhalbert »

There is a simple example here, which I think would also show up in the examples in the Arduino IDE: https://github.com/arduino-libraries/Au ... erZero.ino

In general, for a plain Arduino board, there is not enough flash to hold a .wav file of any size. There are Arduino shields for SD cards so you can play .wav files. Otherwise most Arduino audio is playing tones.

User avatar
Lisa_M
 
Posts: 10
Joined: Mon Dec 17, 2018 2:56 pm

Re: Circuit Playground Arduino wav file

Post by Lisa_M »

Thank you, I'll check that out. Much appreciated.

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”