cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ajones
New Member

Play .WAV with OnSelect

I've uploaded a small .WAV sound effect file to my app's audio media, and I'd like it to play whenever a button is selected.  I've seen the UpdateContext approach, but I can't figure out how to specify which audio file should play.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi Ajones,

 

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). When I click the button, the audio file would be played.

 

This article about Audio and Video controls in PowerApps could be a reference for you:
https://powerapps.microsoft.com/en-us/tutorials/control-audio-video/

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
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

5 REPLIES 5
v-yamao-msft
Community Support
Community Support

Hi Ajones,

 

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). When I click the button, the audio file would be played.

 

This article about Audio and Video controls in PowerApps could be a reference for you:
https://powerapps.microsoft.com/en-us/tutorials/control-audio-video/

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
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

That worked perfectly.  Thanks!

To further this, would it be possible for a button to be pressed, then sound plays, but activity only takes place after sound has finished.  OnSelect Wait for sound to finish, then navigate to another screen.  Otherwise the sound it cut short upon navigate.  Alternatively is it possible to play a sound from another screen?

Anonymous
Not applicable

Hi @DavidBarclay

 

There is no "Wait until sound is finished" however if you want to play the sound when a button is clicked and then navigate away.

 

You can setup this with using timer (you will have to manually set the delay). This way when someone presses the button you can play the sound and start the timer, after timer ends it can Navigate to your next screen.

 

 

Thanks for the tip, it a solution to my challenge.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,129)