I'm writing a psychology app in jQuery. Part of my project requires measurement of the reaction time of a user to a sound (user presses a key). Thus, I need to play a sound file with the smallest possible lag between when I call (& timestamp) the sound file and when it actually starts playing. Most sound plugins don't detail how they handle lag. Please advise me on the best method!
Only answers rooted in solid CS (not "this plugin sounds fast") are useful to me. At the very least, I need to know what the possible range of lag is for the method I'm using (for calculating a confidence interval).
An alternative and actually preferable solution would be a method of quantifying the lag. In that case the length of lag would be unimportant, because I can easily correct for it.
I don't know what sound files I'll be using, but I think they'll be very small. Two .wav files @ 100kb each is probably a safe estimate.