Script for Enabling PHP Autoplay Sound with HTML 5

Asked By 0 points N/A Posted on -
qa-featured

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?

 
SHARE
Best Answer by May Jratr
Answered By 0 points N/A #153630

Script for Enabling PHP Autoplay Sound with HTML 5

qa-featured

 

 
 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>
Best Answer
Best Answer
Answered By 0 points N/A #153631

Script for Enabling PHP Autoplay Sound with HTML 5

qa-featured

 

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,

Login/Register to Answer

Related Questions