“JavaScript Play Audio” Respostas de código

Jogue o som JavaScript

var audio = new Audio("folder_name/audio_file.mp3");
audio.play();
Combative Cheetah

Jogar som em javascript

<script>
function play() {
  var audio = new Audio('https://interactive-examples.mdn.mozilla.net/media/examples/t-rex-roar.mp3');
  audio.play();
}
</script>
<button onclick-"play();">PLAY MY AUDIO</button>
ZDev1

Jogue áudio no clique em JavaScript

<button onclick="playSound()">Play</button>

<script>
let playSound = () => new Audio("src.mp3").play();
</scirpt>
moghaazi

Jogue áudio em JavaScript

var audio = new Audio('audio_file.mp3');
audio.play();
Obnoxious Opossum

JavaScript Play Audio

//play audio with from html audio element: 
document.getElementById('myAudioTagID').play();

//play audio with out html audio tag
var myAudio = new Audio('my_great_song.mp3');
myAudio.play();
Grepper

JavaScript Play Audio

//play audio with from html audio element: 
document.getElementById('myAudioTagID').play();

//play audio with out html audio tag
var myAudio = new Audio('my_great_song.mp3');
myAudio.play();
FabianX

Respostas semelhantes a “JavaScript Play Audio”

Perguntas semelhantes a “JavaScript Play Audio”

Mais respostas relacionadas para “JavaScript Play Audio” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código