Hurol Aslan
May 18th, 1999, 02:34 PM
Hello to all,
I am writing a simple VC++ application which will play some short tunes and wait for keyboard input from the user. It will then determine the time difference between the starting moment of the tune, and the key press from the user and record that as the reaction time. This will be done many times in a loop. (yes, you guessed it, it's a psychology experiment)
For timing, I am using the QueryPerformanceCounter; I found the code in an example downloaded from CodeGuru. It's supposed to be quite accurate; in any case, I need a resolution of 1 ms only.
My problem is that, how can I determine when the MCI control really started playing the audio file?
Will I have to derive my own control and add some code to it? Even if I do that, even a short piece of code does not always run in the same time period from one run to another. Can anyone suggest a method of accurately measuring the time period between the beginning of the audio and the keydown message?
Hurol Aslan
I am writing a simple VC++ application which will play some short tunes and wait for keyboard input from the user. It will then determine the time difference between the starting moment of the tune, and the key press from the user and record that as the reaction time. This will be done many times in a loop. (yes, you guessed it, it's a psychology experiment)
For timing, I am using the QueryPerformanceCounter; I found the code in an example downloaded from CodeGuru. It's supposed to be quite accurate; in any case, I need a resolution of 1 ms only.
My problem is that, how can I determine when the MCI control really started playing the audio file?
Will I have to derive my own control and add some code to it? Even if I do that, even a short piece of code does not always run in the same time period from one run to another. Can anyone suggest a method of accurately measuring the time period between the beginning of the audio and the keydown message?
Hurol Aslan