cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Sound horn to control audio play in App

Hi,

 

The idea is to have a Sound horn that will control the continuous playing sound in my gamification app.

I made two horn signs ,one disable and one enable by using the visibility properties. I managed to use the disable to switch of the sound but the enable is not playing the sound again. Please help me identify the error.

Disable horn is called Revhorn variable used on visibility is VisRevhorn

Enable horn is called Horn variable used on visibility is VisHorn

Audio1 is the media tagging to audio file 'La Bamba'

PlayAudio is the variable to control the Audio play.

App onstart.jpgAudio setting.jpgdisable horn onselect.jpgdisable horn variable.jpgenable horn onselect.jpgenable horn variable.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @nchandran ,

 

Ok, please try the following steps to see if it works for your case.

1. modify the App.OnStart: Set(play,true);Reset(Audio1);

2. modify the horn.OnSelect:  Reset(Audio1);Set(play,!play) , horn.Visible: !play

3. modify the Revhorn.OnSelect:  Reset(Audio1);Set(play,!play) , Revhorn.Visible: play

 

 GIF_82.gif

Sik

View solution in original post

6 REPLIES 6
Highlighted
Community Support
Community Support

Hi @nchandran ,

 

You need to move the Reset() function in front of Set() function.

OnSelect:  Reset(Audio1);Set(PlayAudio,!PlayAudio);

Hope this helps.

Sik

Highlighted

for both horns i've set this, disable horn switches off the sound when its playing but when I onselect enable horn its not playing back.

Reset(Audio1);Set(PlayAudio,!PlayAudio);UpdateContext({VisHorn:true});UpdateContext({VisRevHorn:false})

 

 

Highlighted

Hi @nchandran ,

 

Ok, please try the following steps to see if it works for your case.

1. modify the App.OnStart: Set(play,true);Reset(Audio1);

2. modify the horn.OnSelect:  Reset(Audio1);Set(play,!play) , horn.Visible: !play

3. modify the Revhorn.OnSelect:  Reset(Audio1);Set(play,!play) , Revhorn.Visible: play

 

 GIF_82.gif

Sik

View solution in original post

Highlighted

the audio doesnt play at start anymore.

The horn do not enable or disable anything now.

 

onstart App.jpgVIs horn.jpgVIs revhorn.jpg

Highlighted

Hi @nchandran ,

 

It works perfectly on my side.

I suggest you create a new app and then following the above steps i posted to avoid any unexpected factors.

Sik

Highlighted

I had to state the sound properties of the audio, under start to the sound variable.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,524)