Friday, May 11, 2018

the audio HTML tag!

https://earldouglas.com/posts/sad-trombone.html will not load for me outside of my workplace so it may not load for you either, but it has this example when it does load:

<audio id="audio" src="https://earldouglas.com/posts/sad-trombone/sad-trombone.mp3"
      preload="auto">

 
 

Whoever made this content, an Earl Douglas I suppose, interacts with the .mp3 file from JavaScript like so:

<script>
   function play() {
      var audio = document.getElementById('audio');
      audio.currentTime = 0;
      audio.play();
   }
</script>

 
 

If you clicked upon these monsters, what noise should you hear?

 
 

Maybe your imagination is better than sound on the web. Sound is kind of tacky like blinking text, eh? Very 1990s like under construction "We're working on it" signs. Grow up.

No comments:

Post a Comment