â ī¸ Warning â ī¸ Deprecated Code! This video tutorial contains outdated code.
đĄ If you wish to update it, any AI assistant will update the code for you in seconds.
đĄ If you wish to update it, any AI assistant will update the code for you in seconds.
Audio Play Speed Setting playbackRate Tutorial
Learn to add playback speed control to your HTML5 audio and video multimedia programs using JavaScript.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
function initAudio(){
var audio = new Audio();
audio.src = "audio/Stoker.ogg";
audio.play();
var speedlist = document.getElementById("speedlist");
speedlist.addEventListener("change",changeSpeed);
function changeSpeed(event){
audio.playbackRate = event.target.value;
}
}
window.addEventListener("load", initAudio);
</script>
</head>
<body>
<select id="speedlist">
<option value="1">change speed</option>
<option value=".5">.5</option>
<option value="1">Normal</option>
<option value="1.5">1.5</option>
<option value="2">2</option>
</select>
</body>
</html>