title: How to play mp3 file in Vue3
body: <p>below is my code</p>
  <pre class="lang-js prettyprint-override"><code>audio.value?.play();
  </code></pre>
  <p>will cause 'paused on promise rejection' in chrome</p>
  <pre class="lang-js prettyprint-override"><code>&lt;template&gt;
    &lt;div&gt;
      &lt;audio
        hidden=&quot;true&quot;
        ref=&quot;audio&quot;
        src=&quot;../../../assets/music/boom.mp3&quot;
      &gt;
      &lt;/audio&gt;
    &lt;/div&gt;
  
  &lt;/template&gt;
  &lt;script lang='ts'&gt;
  import { defineComponent, onMounted, ref } from &quot;vue&quot;;
  export default defineComponent({
    name: &quot;CommunicateVoice&quot;,
    setup() {
      const audio = ref&lt;HTMLDivElement&gt;();
      onMounted(() =&gt; {
        audio.value?.play();
      });
  
      return {
        audio,
      };
    },
  });
  &lt;/script&gt;
  
  </code></pre>