Skip to Content
Author's profile photo Sanjoy Saha

Give an error/warning sound to the user when an error occurs in Application

Here we go. It is a very helpful example for make user friendly application by using HTML5 audio tag. When an error occurs, users can be notified by a sound.

In index.html write this:

<body class="sapUiBody">
  <div id="content"></div>
  <audio id="idErrorSound">
  <source src="audio/ErrorSound.mp3"></source>

Now write a small javascript which can be called from your application when you found an error/mistake done from user end:

function playErrorSound() {
  var audio = document.getElementById("idErrorSound");;

Now here we can see a small code snippet where we are calling this js written above:

if (error) {
        // open a dialog to give user a message

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Laurent DUBOIS
      Laurent DUBOIS


      I'm trying to implement this solution. It's working when I execute the application from my local WebIde, but when I deploy the application on the gateway it doesn't work... It seems that the mp3/wav is not published correctly into the BSP... Any ideas how to fix this?