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

Play a Sound On Click button

Hello everyone.

 

I had uploaded a WAV audio to my App’s Audio Media. Then I added an Audio control and a Button control to my App, I set the Audio’s Media property to the file name that I added, and set its AutoStart property to if(Button.Pressed, true, false)

Unfortunately, this formula gives me an error.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @bitvrbit ,

Do you want to play the Sound when you press the button?

 

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:

1.JPG

 

2.JPG

 

Set the OnSelect property of the "Start/Stop" button to following:

UpdateContext({IsStart: !IsStart})

 

Set the Start property of the Audio control to following:

IsStart

set the OnEnd property of the Audio control to following:

Reset(Audio1);UpdateContext({IsStart: false})

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @bitvrbit ,

Do you want to play the Sound when you press the button?

 

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:

1.JPG

 

2.JPG

 

Set the OnSelect property of the "Start/Stop" button to following:

UpdateContext({IsStart: !IsStart})

 

Set the Start property of the Audio control to following:

IsStart

set the OnEnd property of the Audio control to following:

Reset(Audio1);UpdateContext({IsStart: false})

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hello 

Thanks for your help, I discovered the reason why the formula did not work. Instead of the virgo the semicolon must be inserted. Or noticed this problem in various old posts that mentioned formulas of various kinds. 🙂

If(Button7.Pressed; true; false).

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (65,799)