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.Note www-data was added to the audio group, and www-data owns the music directory and music files.
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>
Statistics: Posted by neilgl — Tue Aug 20, 2024 8:03 pm