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

Play audio file on timer end

This should be simple, right? OnTimerEnd = (name of audio file). Not happenin. I have the timer set as a countdown timer: Text = Text(Time(0, 0, (Timer2.Duration-Timer2.Value)/1000), "[$-en-US]mm:ss.f") Not sure if that makes a difference but when it hits 0:00, nothing happens.
7 REPLIES 7
Highlighted
Community Champion
Community Champion

Re: Play audio file on timer end

Hi @hughrmarks,

If I understand correctly, you want audio to play upon a timer ending.

 

You are on the right track. There's a few things to understand to proceed:

  • audio needs to be played from an audio control
  • as PowerApps is like Excel in being a more declarative language, you cannot directly tell things what to do.

 

Here's a way you can set this up:

Insert these controls:

  • Timer2: this is your countdown timer
  • Audio1: this is an audio playing control

Setup these properties

 

Timer2.OnTimerEnd: 
Set(playAudio,true)
Audio1.Start: 
playAudio

Audio1.OnEnd:
Set(playAudio,false)

The big idea:

Timer2 ends -> triggers a variable true -> when variable is true, then Audio plays -> when audio is done, it returns variable to false

 

Please let me know if this helps. Attached is an app file in a zip that illustrates this.

 

Mr. Dang

 

_____________________________

Microsoft Employee
@8bitclassroom
Highlighted
Advocate I
Advocate I

Re: Play audio file on timer end

Hey @mr-dang

I want to build a pomodoro-app, where the audio should play after the countdown is finished, but with the app-screen bot being open (because I'm working on sth else instead). Haven't found a way yet.

 

Any ideas if/how this is this possible?

Thx!

Highlighted
Power Apps
Power Apps

Re: Play audio file on timer end

@Imke , by default the timer and audio controls have an AutoPause property that is set to true. This means that when the screen is not active, the controls will pause. If you flip that to false, then they can continue going.

 

Can you flip it to false and let me know if it works out for you?

Highlighted
Advocate I
Advocate I

Re: Play audio file on timer end

Thank you @Mr-Dang-MSFT  for quick response, but this doesn't work unfortunately. 

The Auto-Pause settings don't seem to have any effect on this behaviour.

 

There is even an idea for this "feature", but I see it more as a current bug: 

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Timer-Control-Running-In-Background/idc-p/269498...

 

Highlighted
Power Apps
Power Apps

Re: Play audio file on timer end

Ahh to clarify, you want it to continue when the entire app is not in view in the browser/app.

Highlighted
Advocate I
Advocate I

Re: Play audio file on timer end

Yes, that's correct.
Highlighted
Advocate I
Advocate I

Re: Play audio file on timer end

Hi @Mr-Dang-MSFT ,

do you think there is a chance to make this working?

Thanks and cheers,

Imke

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,344)