I'm trying to have a php script play an audio file when run
shell_exec('aplay /home/andrew/www/audio/meeting-bell/medium-bell.wav')
It works when I run it from the command line, but not when running it from PHP.
I'm running Apache under the same user name (andrew), but when I run it from the command line (via SSH) it plays with no complaints.
However, when I trigger the script from PHP, I get the following error:
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:682: audio open error: No such file or directory
I looked around and people recommended that I add the user (andrew) to the 'sound' group.
When I try to do this, I get a message saying that:
useradd: group 'sound' does not exist
I'm not really sure what to do from here... Anyone have any tips for setting up an audio group... Am I headed in the right direction?
/dev/snd/
? What is the output ofid
executed from PHP?