Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3755

Troubleshooting • Re: CVLC working from CMD but not from PHP

$
0
0
Maybe try a simple example that plays one .wav file (Rammstein) links234.wav using aplay. Audio is set to AV Jack. No monitor attached to HDMI.
This works on my Pi4 running Bookworm 64-bit with apache2 and php 8.2. powered speaker connected to 3.5mm jack.

Code:

<!DOCTYPE html><html>  <head>  <meta charset="UTF-8" />  <title>php test</title>  </head><body>Simplest example to play one song<br><?php    shell_exec( "aplay /var/www/html/music/links234.wav" );?></body></html>
Note www-data was added to the audio group, and www-data owns the music directory and music files.

Statistics: Posted by neilgl — Tue Aug 20, 2024 8:03 pm



Viewing all articles
Browse latest Browse all 3755

Trending Articles