quanliking Posted October 18, 2018 Posted October 18, 2018 I am developing a 'Service evaluation system' use uniGUI. I tried to modify example "HTML5 Audio", but it not work. I can hear sound by click the button with my finger, but can not hear sound by triggering by an event, for example MQTT publish event.I think it is Chrome browser js restrictions. Can anybody provide examples? Thanks. Quote
Sherzod Posted October 18, 2018 Posted October 18, 2018 Hi, 14 minutes ago, quanliking said: I tried to modify example "HTML5 Audio", but it not work... Can you make a simple testcase for this.. ?! Quote
quanliking Posted October 21, 2018 Author Posted October 21, 2018 Thanks, Sherzod, irigsoft I am use sgcWebSocket for MQTT communication, I can not give the example by now. because sgcWebSocket publish event handler can not execute the playsound logic right(can not hear sound), so I put a timer with a MainForm variable(not global variable) named 'IsAudioOn', where 'IsAudioOn' is true, timer play sound. It seem no problem at the surface, but I have 64 win10 terminals, and I find only part of terminals play sound, others could play sounds only after I touch the physical 'volume control key' with my hand. It is weird. I tried many times and reached a conclusion that that browser play sound is not reliable when you have many devices to play sounds, not work every time. Now I have Client + Browser architecture, Client play sounds with sgcWebSocket MQTT for communications and Browser embed in Client do business logic with sgcWebSocket MQTT for communications.It is compromise that part business logic(play sound)move to Client, but it is reliable. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.