Answers for "play audio html"

1

audio in html

<audio controls>
<source src="sound.ogg" type="audio/ogg">
<source src="sound.mp3" type="audio/mpeg">
No audio support.
</audio>
Posted by: Guest on August-05-2021
10

play audio in javascript

var audio = new Audio('audio_file.mp3');
audio.play();
Posted by: Guest on May-20-2020
7

how do you play audio files on html

<audio src="sound.mp3" autoplay></audio>
Posted by: Guest on March-15-2020
1

play audio source on html

<audio controls>
  <source src="myAudio.mp3" type="audio/mpeg">
  <source src="myAudio.ogg" type="audio/ogg">
  <p>Your browser doesn't support HTML5 audio. Here is
     a <a href="myAudio.mp4">link to the audio</a> instead.</p>
</audio>
Posted by: Guest on February-17-2021
1

how to display audio in html

_______________________________________________________________________________________

###                         Audio(s)                         ###


### Adding a audio file is almost the same as adding a video file here is the basic code line :
<audio controls >

    <source src="Type here the location of your audio" />
</audio>

### just like adding a style to video(s) its done like this :
<audio controls  class="The name of your style" >

    <source src="The location of your audio" />
</audio>

### If you don't know how to make a style? i will be maybe uploading a tutorial on it later 


### You can customize the audio if you don't want to use a style very easy
<audio controls autoplay loop preload="" >

    <source src="The location of your audio" />
</audio>

### "autoplay" = It will play automaticly when you go to the html page
### "loop"     = If you add this the file will never stop playing. when it ends it will start over again
### "preload"  = You have 3 types of preloading. 1="auto" It will automaticly load. 2="metadata" It will load before the metadata. 3="none" It will just load 
### like it normaly does

### You can also add above or under the line <source> the words: "Your Browser does Not support This music File. Please Try another browser"
### You just have to add the text nothing else and it will display when the audio file can't load. 



## here is an example i made:
<audio controls autoplay loop preload="metadata" >
    <source src="/audio/audiofile3904.mp3" />
    Your Browser does Not support This music File. Please Try another Browser
</audio>

_______________________________________________________________________________________

# If this code helped you please leave a like on it. If you want to see more of this follow me
# Or just take a look at another answer of my answers
#
# THIS CODE HAS BEEN MADE BY : Vast Vicuña
Posted by: Guest on September-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language