title: Why can't audio.play () be executed, I looked in inspect element and saw some sort of Uncaught error (in promise) DOMexception
body: <p>I'm getting the error message!</p>
  
  <pre class="lang-js prettyprint-override"><code>let fillbar=document.querySelector('.fill');
  var audios= [&quot;HOTEL_LOBBY.mp3&quot;, &quot;FROZEN.mp3&quot;, &quot;DOUBLE_UP.mp3&quot;];
  let covers=[&quot;popsmoke.jpg&quot;,&quot;2scratch.jpg&quot;,&quot;ian.jpg&quot;];
  let currentTime=document.querySelector(&quot;.time&quot;);
  
  //Create an Object of Audio
  
  let audio = new Audio();
  let currentSong = 0;
  
  // whenever the window load, the song should play automatically
  
  window.onload = playSong;
  
  // let's play the song by this function whenever window load
  
  function playSong() {
    audio.src = audios[currentSong];
    audio.play();
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/wqt1e.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I also checked other questions that arose related to this problem but nothing works for me or at least I think so. I am at the beginning and it is very difficult for me to figure out what I need to do to solve this problem.</p>