Hello!
I have a panel and a button in it. I want to play sound when I click the button.
I use startSound() function on Clicked event of the button:
startSound(DATA_PATH + "sounds/ringin.wav");
It works if I open panel on the WinCC OA server. But it doesn't work if I open panel in the Desktop UI.
Could you tell me, please, how to play sound in the Desktop UI?
Best regards, Ilya
How to play sound in the Desktop UI?
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: How to play sound in the Desktop UI?
Probably the wav file is missing at the Desktop-UI computer.
Can you please check if an error is reported in the logfiles when trying to start the sound.
In the "Notes and Restrictions" for the Desktop-UI you can find the following information:
If accessing other files using File functions it must be regarded that they maybe have not yet been imported to the cache directory on the client. Thus, always use file functions together with the getPath() function. getPath() sends an HTTP request to the web server to download the current version of the file. This means that without getPath() this will never be present on the web client computer.
Best Regards
Leopold Knipp
Senior Support Specialist
Can you please check if an error is reported in the logfiles when trying to start the sound.
In the "Notes and Restrictions" for the Desktop-UI you can find the following information:
If accessing other files using File functions it must be regarded that they maybe have not yet been imported to the cache directory on the client. Thus, always use file functions together with the getPath() function. getPath() sends an HTTP request to the web server to download the current version of the file. This means that without getPath() this will never be present on the web client computer.
Best Regards
Leopold Knipp
Senior Support Specialist
- i.mak
- Posts:18
- Joined: Mon Mar 27, 2017 3:00 pm
Re: How to play sound in the Desktop UI?
Hello, Leopold!
Yes, error was reported in the Desktop UI logfiles.
And with the getPath() function it works!
Thank you very much!
Best regards, Ilya
Yes, error was reported in the Desktop UI logfiles.
And with the getPath() function it works!
Thank you very much!
Best regards, Ilya