Author Topic: Audio playback on Wiring  (Read 1911 times)

0 Members and 1 Guest are viewing this topic.

gcarrillo

Audio playback on Wiring
« on: October 06, 2013, 11:15:15 PM »
Hi all,

first of all, I'm sort of new into electronics. I bought another microcontroller some months ago and learnt a bit about basic circuits and the like. Now, I'd like to learn about Wiring (and also to support this initiative), but before I have a question for you.

I'd like to ask you if it's possible to program an audio playback on Wiring. I'm happy with the results of this [1] arduino-based tutorial in order to reproduce a very short audio file. Note that for such task, the only things I actually need are the arduino microcontroller, a speaker, and two jumpers (i.e., no extra hardware is required). Do you think I could do the same with Wiring? Is there a library similar to arduino's PCM (see [1]) in order to work with audio files on Wiring?

Thanks in advance,

gcarrillo
---------
[1] http://hlt.media.mit.edu/?p=1963

barragan

Re: Audio playback on Wiring
« Reply #1 on: October 11, 2013, 10:58:46 AM »
To reproduce Audio in Wiring is basically the same setup as in Arduino, please try to connect the things in the same way and let us know if you have any issue. You can use the PCM library with Wiring, just copy it to the Documents/Wiring/libraries folder, you'll probably have to change in the source code to include "Wiring.h" instead of "Arduino.h".

gcarrillo

Re: Audio playback on Wiring
« Reply #2 on: October 16, 2013, 10:50:03 PM »
Thank you Hernando. I'll acquire the Wiring hardware in the next couple of weeks and let you all know about the experience.

BTW, congratulations for Wiring!

Regards,

Germán

barragan

Re: Audio playback on Wiring
« Reply #3 on: October 20, 2013, 02:55:16 AM »
Thanks!

gcarrillo

Re: Audio playback on Wiring
« Reply #4 on: November 21, 2013, 10:27:28 PM »
Well, after tweaking some code it works (it sounds)!

Besides replacing Arduino.h by Wiring.h, I had to change pin 11 to pin 7 in the PCM.c file and (this could sound weird) comment lines 121-125 in cores/AVR8Bit/WHardwareTimer.cpp because I was getting errors due to a multiple definition of `__vector_13' (PCM.c contains a similar line of code).

Thanks again for your guidance.

Regards,

Germán