62
Views
4
Comments
Solved
alert or notification sound required.

we have a dashboard screen, in that dashboard screen we are showing the count of user entity, whenever a new user created, we are increasing the count on the dashboard, we required a functionality like whenever a new user record insert into entity, along with increasing count on the dashboard, I want to give some system sounds or audio (like notification sound)


suggest me how to do that.

2023-08-18 10-40-36
Deepak M
Solution
imgpsh_fullsize_anim.png
imgpsh_fullsize_anim (1).png
2023-08-18 10-40-36
Deepak M

Hi Priya Naveen,


Call a Js where you want to raise a sound and paste the below mentioned query inside that.


const successSound = new Audio('paste here the audio path url');

successSound.play();

successSound.volume = 0.15; 

2024-06-03 11-04-24
Priya Naveen

could you please provide any working sample audio path url

2023-08-18 10-40-36
Deepak M
Solution
imgpsh_fullsize_anim.png
imgpsh_fullsize_anim (1).png
2021-11-12 04-59-31
Manikandan Sambasivam

To achieve this functionality in OutSystems, you can use the following approach:

  1. Create an Audio Element:

    • Add an Audio widget to your screen. This widget will be hidden and will play the notification sound when triggered.
  2. Trigger the Audio Playback:

    • In the logic where you insert a new user record, after increasing the count on the dashboard, you can use the JavaScript node to trigger the audio playback.
    • Use the Play action of the Audio widget to play the notification sound.

Example :

  1. Create an Audio Element:

    • Add an Audio widget to your screen and set its Source property to the URL of your notification sound file. For example, if your notification sound is named "notification.mp3" and is located in the "Resources" folder of your module, you would set the Source property to GetEntryURL("Resources.notification.mp3").
  2. Trigger the Audio Playback:

    • After increasing the count on the dashboard (assuming you're doing this in a server action), add a JavaScript node to the server action flow.

    • In the JavaScript node, use the following code to trigger the audio playback:

      javascriptCopy code$parameters.AudioId.play();

    • Ensure that the JavaScript node has an input parameter named AudioId of type AudioSource that references the Audio widget on your screen.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.