Go Down

Topic: Problem with runShellCommand and Madplay (Read 403 times) previous topic - next topic


Dec 01, 2017, 01:15 am Last Edit: Dec 01, 2017, 01:21 am by Herminator
I'm working on a small project for the holidays, using an arduino yun, a usb soundcard and madplay. The problem I'm having is that I can't get it to work in my own sketch.

The serial print keeps looping, so the code seems to work - but it might be skipping the audio file.

#include <Process.h>

const int buttonPin = 2;

int buttonState = 0;
Process p;

void setup() {
  pinMode(buttonPin, INPUT);    

void loop(){
  buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH) {    
    p.runShellCommand("madplay /root/svfout.mp3");
    Serial.println("it works!");
  else {
Using the terminal example, I can play the audio just fine. Meaning it isn't a hardware or file problem  :smiley-confuse:
I'm totally stuck at the moment, so any help would be greatly appreciated!

I used this tutorial: https://dev.mikamai.com/2013/12/12/arduino-yun-with-sound-the-supereasy-way/

Go Up