HomeLinuxLearn how to Make Audio Autoplay on Chrome

Learn how to Make Audio Autoplay on Chrome


There are web sites which have autoplay options together with different parts. This makes the content material of the online web page extra comprehensible and a few web sites basically require this characteristic, as an example, if there’s a child studying web site, it can require audio options for positive. Audio autoplay in chrome could be simply inserted utilizing HTML markup language via the audio tag. By this, the person that interacts with the online web page can simply hear the audio.

Syntax for audio Tag

Audio autoplay is inserted via the audio tag with the controls autoplay attribute. Whereas writing, merely add an audio tag with controls autoplay attribute and add the supply audio file location from the system after src=:

<audio controls autoplay>
        <supply src=“audio-mp3.mp3” sort=“audio/mp3”>
</audio>

 
Notice: The controls attribute is used to make the audio factor seen on the interface and the audio attribute is used to begin the audio.

Learn how to Use audio Tag to Autoplay?

The person can insert the audio factor anyplace on the interface. As an illustration, if we need to make an audio autoplay on a clean internet web page beneath a easy <h1> heading. To insert an audio autoplay factor on an online web page:

<h1 fashion=“colour: rgb(121, 25, 84)”>
         Audio Autoplay in Chrome
    </h1>
    <audio controls autoplay>
        <supply src=“audio-mp3.mp3” sort=“audio/mp3”>
    </audio>

 
The above code will create the next output and the audio can be performed routinely on loading the online web page:


That is how we will create an audio auto play on chrome via a easy HTML audio tag.

Conclusion

Audio auto play could be simply created on chrome via a easy HTML audio tag. All it requires is so as to add the audio tag with a controls autoplay attribute after which add the situation of the supply mp3 file from the system contained in the audio tag. This shows the audio factor on the internet web page and the audio is performed routinely when the online web page is loaded. This publish defined effectively easy methods to make audio auto play on chrome.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments