system.util.playSoundClip only work on gateway

I make a soundplay program. I test it on gateway.it’s ok.
but when I use other computers to connect this gateway.I can’t heard anything from the new computer.

Perspective or Vision? In Perspective, it can’t be a local sound file. It has to be a URL served from elsewhere. Using Webdev or your own infrastructure.

(I vaguely recall this not working in Perspective until recently… the version you are using might matter.)

1 Like

Hello, experts.thank you for your answer. I am using both perspective and version.my audio was played by scripts,not on graph.

Tag events run on the gateway. So that’s where the sound plays. If you want to play the sound in Vision, you’ll need to use a tag change script in the project’s client events and play the sound from there. In Perspective, you’ll need to bind the tag to a custom session property, and play the sound from a propertyChange event on that custom property.

thank you very much.with your answer,I have solved the version sound problem. but at perspective ,it still not work.I tried two places.image .with this way ,I use the script:system.perspective.sendmessage().this way ,only gateway sound,other remote clients no sound. 2. I tried image ,even the gateway no sound.I use the system.util.sendmessage()

All scripting in Perspective happens on the gateway, so playSoundClip will never work for what you’re trying to do.

For now, the only way to have a Perspective client play a sound is using the workaround mentioned in this thread:

We’re considering adding a scripting solution or some other way to actually play a sound from a Perspective component, but for now, that’s the solution.

2 Likes

thank you very much for your advise.I tried the way as your way. It’s work when the page is opened, so I put the iframe on the top solid windows ,so every page could play the audio when alarm comes.:orange_heart::orange_heart::orange_heart::orange_heart:

A post was split to a new topic: system.util.playSoundClip not loading local file