Как воспроизводить звуки в js

Примеры кода

17
0

воспроизведение звукового javascript

var audio = new Audio("folder_name/audio_file.mp3");
audio.play();
5
0

воспроизведите звук с помощью js

var audio = new Audio('audio.mp3');
  audio.play();
3
0

воспроизведение аудио на javascript

//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();
2
0

воспроизведение звука на 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>
2
0

как воспроизводить звук при загрузке js

 <audio id="foobar" src="yoursample.ogg" preload="auto"> 

Похожие страницы

Похожие страницы с примерами

На других языках

Эта страница на других языках

English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................