Giter Club home page Giter Club logo

play-pcm-example's Introduction

Playing PCM audio using Timer3

This is an example on how to play a raw 8bits 8KHz PCM audio sample using one of the ATmega32u4 PWM pins and the Timer3 library:

http://arduino.cc/playground/Code/Timer1

There are other examples/ways of doing this, most notably:

https://github.com/damellis/PCM/

But I couldn't make it work in Arduino Leonardo or Teensy 2.0, both based on ATmega32u4.

After reading the docs pointed in the 'references' section of this document, I found out that the same can be achieved using the Timer3 library.

The sample can be genereated with raw2c.c tool:

  1. sox -V coin.wav -b 8 -t raw -r 8000 coin8.raw
  2. raw2c coin8.raw coin8.h

The code has been tested with Teensy 2.0 only.

Demo: https://plus.google.com/104932008385650668491/posts/BE91htfJ1R9

References

Juan J. Martínez [email protected]

play-pcm-example's People

Contributors

reidrac avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.