1

I am currently struggling on a project I am working on. I am supposed to control the audio output of a raspberry from a computer or another device. I installed an apache server and I want to execute a command line so I can control the audio output.

I know I have to do it with the exec() function. But for a reason I don't know yet, very commands seems to work fine execpt the one that actually drive the audio output. I tried using omxplayer as a music player, mpg123 as well and I tried by using pygame and I wrote a python script that uses the audio output.

My problem is that all of these solutions works on the shell but don't work when they are on the PHP command. While I can use the command cp or mv to move files of the raspberry from the server and it actually works.

It seems like everything is working on its own but do not when I put everything together.

Anyway thank you for taking time to help me

Exo
  • 19
  • 1
  • related (albeit not answered there) https://raspberrypi.stackexchange.com/questions/19482/using-php-exec-command-to-play-audio-on-the-pi-no-audio-group My guess would be to include the user that runs the PHP script (the user that runs the webserver?) in the audio group, see http://raspberrypi.stackexchange.com/questions/3637/how-to-play-audio-without-being-root-via-sudo – Ghanima May 23 '16 at 13:14
  • I did that, the user is www-data, so I just did gpasswd -a www-data audio which seemed to have worked but the result is still the same. – Exo May 23 '16 at 14:13

0 Answers0