Arduino library for simple wav playback

Arduino Technology

Arduino developer David Cuartielles gives gives us a peek into one of his late night hacking sessions –

If you have nothing better to do during a winter night in Sweden, you can always hack a couple of libraries together and make a third one. SDplayWAV is for people interested in playing sounds from SD cards. Builds upon previous work by Ladyada, Ronald Riegel, and Michael Smith.

Using this new library allows one to play back mono 22kHz 8-bit wav files through PWM on pin 3 of the Arduino. The standalone board seen in the above video is a Smapler, an Arduino-compatible outfitted with audio amp and PS/2 connectivity. [via Arduino Blog]

In the Maker Shed:

Waveshield Kit

10 thoughts on “Arduino library for simple wav playback

  1. Anonymous says:

    Presumably they don’t output 22 kHz though. Isn’t the pwm too slow?

  2. dcuartielles says:

    1. the link to the library is mistaken, I posted it wrong to the Arduino blog and you guys got it wrong here. It should be http://blushingboy.net/p/SDplayWAV/ (note the final slash)

    2. to the previous comment, we use fast PWM that we can update at e.g. 250KHz, the price to pay is the resolution, which ends up being only 8bits

  3. Collin Cunningham says:

    thanks – updated

  4. Collin Cunningham says:

    @Dane – as mentioned in the video, pin 11 is used for communication with the SD card preventing a second PWM from being used

Comments are closed.

Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK