Playsound delay

B

Brian

A recent post made me think of this:

Right now in my Alarm Clock app I'm playing a sound continously for N amount
of time. I play the sound with the Continous Loop and Async flags, then
once N time expires, the app plays a null sound to stop. This works fine.

But, for this app I think it's best to delay the continous playing of the
sound, for example, 200 milliseconds between each play. Without a delay,
short beeps sound more like a continous tone.

I can't think of a good way to implement this, because the alarm sound is
user configurable so the length of WAV file is unknown, and I prefer an
async solution so the app will continue in the background.

This is a minor issue: an easy workaround is to pad the WAV with silence,
but that's a tad cheesy. Any ideas?

Thanks,
Brian
 
J

Jay Abbott [msft]

Play the sound Synchronously instead of Asynchronously and use 2 timers. 1 timer for the delay between each sound and the other timer for the amount of
time you want the sound to repeat.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top