Customised audio with message in ITS RF Scanners
Hi members,
A lot of time I have seen questions on internet asking about changing RF Scanner beep sound to some customised one as per message or at some place asking about Sound not coming in mobile browsers in RF Scanners with ITS.
So in today’s Blog I am providing the solution for giving customs sound with message in RF Scanners in Mobile browsers and PC browsers.
PREREQUISITE – :
- ITSMOBILE should be published.
- The following parameters must be defined and enabled –
- ~ITSMOBILEMSGSOUND
- ~ITSMOBILESOUND
SOLUTION -:
In the template of your program screen you can already see the HTML code written like below:
SAP have already provided the code for different sounds as per message But the problem is the <bgsound> tag is obsolete and only supported in Internet Explorer , So in order to run this in latest browsers we will change the <bgsound> tag with <embed> tag.
So replace the code for audio source with below code:
<embed src="`mimeURL(~service="itsmobile", ~theme=99, ~language="", ~name="sounds/all/sapsounderr.wav")`" height="0px" width="0px" loop="3" >
In “src” you can give path of Custom sound which can be uploaded in SAP by creating a mime object .
This solves the problem of having no sound in ITS in Web browsers (PC ONLY) . For mobile browsers please follow further instructions :-
For giving sound notification in mobile browser we need to enable the auto play of audio in mobile browser.
Here I am taking the example of chrome :-
Just goto CHROME://FLAGS in Chrome mobile browser.
And search for :
Then change this policy to :
And then select relaunch now.
After this you will be able to give audio notification with messages in RF Scanner with ITS in Mobile and PC browsers.
This is really helpful , Thanks for sharing
Hi,
Thank you very much... We are able to play the sound from Google Chrome now...
But one more request.. for an error message, we want to play the same sound 3 times and for a warning message 2 times... do you know how we can achieve this via HTML program.
Thank You
Hi,
Solution:
First add custom messagesound in the program as mentioned in https://launchpad.support.sap.com/#/notes/1428050
then under your include/sound
if ( ~currdynpro.messagesound == “E” || ~currdynpro.messagesound == “W” )
if (NOTIFY_BELL_SIGNAL == 5)
` <audio id=’beep5′ controls autoplay hidden>
<source src=”`mimeURL(~service=”itsmobile”, ~theme=99, ~language=””, ~name=”sounds/all/sapsounderr.wav”)`” height=”0px” width=”0px”>
<script type=”text/javascript”>
var count = 0
document.getElementById(‘beep5’).addEventListener(‘ended’, function()
{
count++;
if (count < 5) {
this.currentTime = 0;
this.play();
}
}, false);
</script>
</audio>
**change as per your requirement.(Warning/Success)…
This is done for EWM, therefore the NOTIFY_BELL_SIGNAL is used based on the presentation profile to repeat the sounds * times.
Hi All,
My requirement is to produce beep sound on input of one field. With the above code, i am getting beep sound on page load, but need it when user entered value on one input field.
Can you please help on this