How to play a sound and then close the application

70 views
Skip to first unread message

Gary

unread,
Jan 20, 2012, 5:55:13 AM1/20/12
to theaire...@googlegroups.com
Howdy all

Someone asked me how to play a sound and then quit the application.

Actually she asked for a button that would play a wave and then close the app. I did not ask why anyone would want to limit themselves to playing a wave
and did not comment on asking for a button rather than the blocks

because there are limits on how very picky I can be
  :-)

Her app has a clock, I turned off the TimerEnabled property in the Designer
I changed the button click block to set the clock's TimerEnabled to true
and play the wave

I added a Timer block for the clock and added the close application

and it now plays the sound and then closes the application.

and

She wanted a pause block. I can not think of how to do a block that pauses
  currently :-)

anyone have any ideas?

Gary

Anthony Barnes

unread,
Jan 20, 2012, 6:57:32 AM1/20/12
to theaire...@googlegroups.com
I tried to get a pause button to work once but it is really tricky and very inconsistent. The best way is probably enter an issue to have that added to the player functionality like the video player does.
--

Gary

unread,
Jan 20, 2012, 7:30:57 AM1/20/12
to theaire...@googlegroups.com
The video player pause pauses the video.
She wants to play the sound and then quit the app when the sound is done playing.

That is not really a pause.

The pattern I used is like a JavaScript  setTimeout() or Java Thread.sleep().

There is no way to have the sound run and then have the next block run
or trigger an event when the sound finishes.

Ideas?

Gary



Geo Massar

unread,
Jan 20, 2012, 1:40:28 PM1/20/12
to theaire...@googlegroups.com
How about playing a soundless wave upon the application closing?

Prof Geo

Gary

unread,
Jan 20, 2012, 3:31:10 PM1/20/12
to theaire...@googlegroups.com
If I understand,
play the sound
play a quiet sound
quit the app

I do not know if that works, I assume... sounds are played in their own thread and if the first sound is long and the second is short (and silent) you would get it cutting off the first sound.

And if all this works
it is not real useful for deaf users. 

I would be nice to have a way to wait till a sequence of actions happens and then quit.


Geo Massar

unread,
Jan 20, 2012, 4:06:34 PM1/20/12
to theaire...@googlegroups.com
It is always a good idea to have BOTH sound and visual effects for ALL users to enjoy,

Try the suggestion and see if it works. Never hurt to try.

Geo

Anthony Barnes

unread,
Jan 21, 2012, 12:48:46 PM1/21/12
to theaire...@googlegroups.com
Moved this topic to the new forums on the new tair site.
http://www.tair.info/forums/topic/play-a-sound-then-quit-your-app/#post-629 
Reply all
Reply to author
Forward
0 new messages