IR + Audui = No Sound


I am new here and I hope this is the right place for my problem.


I just want if you click on the mini-ir-controller, that my own created sound-sample is "hearable".
For this first, i created a normal sketch for a mini-sound with a run of 3 seconds, which works.
But if I want combine this with an IR-controller system, it doesnt work(no sound by clicking) because the CODE isn right. So, I want to ask, if someone can help me? by the way, here is the code, but i can´t find the problem.

#include <IRremote.h>

#include <PCM.h>

const unsigned char sample[] PROGMEM = {

int RECV_PIN = 10;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
irrecv.enableIRIn(); // Start the receiver
startPlayback(sample, sizeof(sample));

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value

IR_Audio.ino (80 KB)

I know that the problem lies in the IR library, it does something with a timer which you dont want for your audio purpose.

I have a robot car, controlled by an Mboard. When I used that same IR library the PWM of my left engine stopped working. That and because the IR library eats atleast 10kB of flash memory made me gave up on IR

Solutions I can think of:

  • you can try to look for other similar libraries and try those out
  • A difficult but possible thing is to open the IR library, locate the timer part and let it use an other timer
  • you could try to use other pins for the audio, but I doubt if this will solve anything :frowning:
  • drop the IR and get yourself a sweet bluetooth module. Because BT is frkn easy, works over the serial pins and you can use your phone, laptop, PS3 controller (< takes more work) or an other arduino with an other BT module.