I'm posting this just in case it helps someone some day.
As some of you (or at least two 9ers
) know my cousin and I wanted to see what it was like to make a WP7 app while he was on his Christmas break. http://channel9.msdn.com/Forums/TechOff/Inconsistent-metronome-in-WP7-app
After having problems with the metronome being unstable W3bbo pointed us in the direction of making the metronome run in a different thread so it didn't stop for no reason but because it was still just using a simple timer the metronome didn't keep time teribly well.
Because I'm not a programmer but I deal with pro audio software all the time I thought about how I would do it. While looking at the code we already had, I Right-Clicked on SoundEffect and found that it IS possible to make a sound loop AND modify the start and end loop point of a sound.
// loopLength:
// Loop length in samples.
public SoundEffect(byte[] buffer, int offset, int count, int sampleRate, AudioChannels channels, int loopStart, int loopLength);
Now that I knew this information I figured it would be posisble to make a perfect metronome by simply creating a .wav file with lots of silence at the end then modifying loopLength to make the metronome tick faster or slower. Relying on the playback of a 44100Hz 16bit sample makes for amazingly accurate timing compared to using the system timer.
Here's the code if anyone's interested.
http://www.box.net/shared/5xn4umhgbg

Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.