Issue with response times and loudness in a reading aloud task with voice key
first of all, thanks for the amazing resources that OpenSesame and this forum are.
It's my first experience with a reading aloud task with voice key on OpenSesame. I am using a code that I received from someone else and is largely based on the code posted by Sebastiaan in these two threads (http://forum.cogsci.nl/index.php?p=/discussion/1772/ and http://forum.cogsci.nl/index.php?p=/discussion/107).
The task is as follows: a word is presented until the participant starts reading it aloud, that is, until voice onset, or for a maximum of 2000 ms (our timeout).
After adjusting the microphone parameters in the script and using a professional microphone, we seem to get good quality recordings.
We still seem to have the following issues, about which I'd be extremely grateful for any help.
1) the value for 'loudness' in our output file is always 'None', even though we do get correct recordings and voice onset does trigger disappearance of the stimulus (as desired). I thought that this problem might be related to something in this code snippet, but I cannot see anything obviously wrong:
# variables all= var.A_Response_time = timeout a=0 start_time = clock.time() # Listen for sounds until a sound is detected or a timeout occurs. while True: if clock.time() - start_time >= timeout: var.loudness = None break try: block = stream.read(chunk) all.append(block) except IOError as e: print e loudness = get_rms(block) if loudness > sound_threshold: if a==0: var.A_Response_time = clock.time() - start_time var.loudness = loudness a=1
2) I am not sure whether this point might be related to the first one, in that something might be wrong in the last if-loop reported in the code snippet above. I am attaching a png of a trial recording that I did, hoping it might help. The issue is the following: The RTs that we get look a bit suspiciously too similar to one another. Not being sure whether these RTs are reliable, I tried importing the .wav recordings into Audacity, to see whether the actual RTs could be recovered like that. Ideally, our recording should start at time 0 (that is, when the word appears on the screen), and we expect response times in the order of at least 550-600 ms (so not too far from what we see in the attached results, although these all look suspiciously similar to one another). However, when I opened the audio files in Audacity to try and recover the RTs, I saw that voice onset is always around 300-400 ms, which is very different from what we see in the results, and much earlier than expected, as if the recording is not really starting at 0. Any idea whether this might be related to something in the code?
Thanks a lot in advance,