thingworx studio bgm or effect sound
May 25, 2018
09:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 25, 2018
09:57 PM
thingworx studio bgm or effect sound
I want to sound every time I touch every button.
BGM sound
Effect Sound
How's that without using a widget?
Is there a way to script it?
iam newbie, thank you for your help.
Labels:
- Labels:
-
Coding
1 REPLY 1
May 31, 2018
11:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 31, 2018
11:02 AM
Hi--
To play sound, you'll need to add an audio widget to your 2D layout and add the sound file to your resources. Then turn off the "Visible" and "Show controls" options for the audio control.
Now for each control (e.g. Button) you want to trigger the sound, bind the control's Click event to the audio control's "Play" service.
If you need to play the sound via script, you can use something like this:
$scope.app.fn.triggerWidgetService('audio-1','play');
--Clay