How to i play notification sound on HTML5 after getting response from webscoket request

I made a function in my HTML 5 using Howler and wants to play the sound when I receive a response from the socket but the sound doesn’t play, but the same sound plays when I tried using a button click. This is the function I made for sound

<script>
   var PlayNotificationSound = new Howl ({
     src : ['http://localhost/rystore/resources/assets/sound/notification.ogg'],
     html5: true
});
</script>

And the below code is when I receive a response from the socket

Socket.on("delivery-boy-notification", () =>{
    PlayNotificationSound.play();
    Snackbar.show({text: "You Have Received A New Delivery Order Check Your Inventory"})
})

The message is being shown but the sound is not being played