How do I enable php autoplay sound through html 5 within my script so as to selectively generate sound on some content while discriminating others as instructed by code?
Script for Enabling PHP Autoplay Sound with HTML 5
You can have an audio sound within the script for which you have to write an html code for it . Here is an example of the code which you can change the audio sound according to your need.
<html>
<body>
<audio>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
</body>
</html>
Script for Enabling PHP Autoplay Sound with HTML 5
Hello Bernard Fleck ,
Hope that my message finds you well.
You can use the audio tag that is supported by HTML 5 as the following:
<audio autoplay=”autoplay” controls=”controls”></audio>
Inside the audio tag you will enter the source with the proper SRC as the following:
<source src="Mymusic.ogg" />
OR
<source src="Mymusic.mp3" />
Inside your PHP code you will add the following code
<audio autoplay=”autoplay” controls=”controls”>
<source src="MySound.mp3" />
</audio>
Hope this solution will help.
Kind regards,