What are the best practices for using HTML5 audio tags to play files from external directories in PHP?

When using HTML5 audio tags to play files from external directories in PHP, it is important to ensure that the file paths are properly formatted and accessible. One way to achieve this is by dynamically generating the file path in PHP and passing it to the HTML5 audio tag.

<?php
$audioFilePath = 'path/to/external/audio/file.mp3';
?>

<audio controls>
  <source src="<?php echo $audioFilePath; ?>" type="audio/mp3">
  Your browser does not support the audio element.
</audio>