Input device: Voice record (issue with the latency)


Author
Message
Saru
Saru
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)
Group: Forum Members
Posts: 4, Visits: 32
Hi,

I am currently trying to program an experiment that records the verbal response provided by the participants. I used the /inputdevice = voice record one and it does record the response and also stores recordings. However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between  the stimulus onset (presentation of faces) and the first utterance by the participants.  I am a beginner in Inquisit and i am not sure what can be done for this. Could you please help me with this?

<defaults>
/minimumversion = "4.0.2.0"
/ fontstyle = ("Arial", 6.00%, true, false, false, false, 5, 1)

</defaults>

<values>
/completed = 0
</values>

<item PositiveHappy>
/1 = "004_o_m_h_b.jpg"
/2 = "005_o_f_h_a.jpg"
/3 = "006_m_f_h_b.jpg"
/4 = "007_m_m_h_b.jpg"
</item>

<item NegativeAngry>
/1 = "004_o_m_a_a.jpg"
/2 = "005_o_f_a_b.jpg"
/3 = "006_m_f_a_a.jpg"
/4 = "007_m_m_a_a.jpg"
</item>

<picture PositiveFace>
/ items = PositiveHappy
/ position = (50, 50)
/ size = (40%, 40%)


</picture>

<picture NegativeFace>
/ items = NegativeAngry
/ position = (50, 50)
/ size = (40%, 40%)

</picture>



<text fixation>
/ items = ("+")
/ color = black
</text>

<item BlankScreen>
/1= ""
</item>


<text BlankScreen>
/ items = BlankScreen
</text>


<page welcome>
Welcome to the Experiment 2.
</page>


<page end>
This is the end. Thank you for your participation.
</page>

<instruct>
/ fontstyle = ("Arial", 5%, true)
/ txcolor = black
/ windowsize = (90%, 90%)
/ screencolor = white
</instruct>

<htmlpage CongruentInstruction >
/ file = "In this specific task.htm"
</htmlpage>


<item PositiveInstructionImage>
/1 = "004_o_m_h_b.jpg"
</item>

<picture PositiveInstructionImage>
/ items = PositiveInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item NegativeInstructionImage>
/1 = "004_o_m_a_a.jpg"
</item>

<picture NegativeInstructionImage>
/ items = NegativeInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item VowelI>
/1 = "Bika.wav"
</item>

<sound VowelI>
/ items = VowelI
</sound>

<sound VowelO>
/ items = VowelO
</sound>

<item VowelO>
/1 = "Boka.wav"
</item>

<trial PreInstCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelI; 4500=NegativeInstructionImage; 5500=sound.VowelO ]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial PreInstInCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelO; 4500=NegativeInstructionImage; 5500=sound.Voweli]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial CongruentPositive>
/stimulustimes = [0 =fixation; 500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial CongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentPositive>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000
</trial>

<block Block0>
/ trials = [1-2= noreplace(PreInstCong, PreInstInCong)]
/ preinstructions = (htmlpage.CongruentInstruction)
/ postinstructions = ()
</block>

<block Block1>
/ trials = [1-4= noreplace(CongruentPositive, CongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>

<block Block2>
/ trials = [1-4= noreplace(IncongruentPositive, IncongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>


<expt>
/ blocks = [1=Block0; 2=Block1; 3=Block2]
/ preinstructions = (page.welcome)
/ postinstructions = (page.end)

/onexptend = [values.completed = 1]
</expt>



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 101K
Saru - 4/30/2024
Hi,

I am currently trying to program an experiment that records the verbal response provided by the participants. I used the /inputdevice = voice record one and it does record the response and also stores recordings. However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between  the stimulus onset (presentation of faces) and the first utterance by the participants.  I am a beginner in Inquisit and i am not sure what can be done for this. Could you please help me with this?

<defaults>
/minimumversion = "4.0.2.0"
/ fontstyle = ("Arial", 6.00%, true, false, false, false, 5, 1)

</defaults>

<values>
/completed = 0
</values>

<item PositiveHappy>
/1 = "004_o_m_h_b.jpg"
/2 = "005_o_f_h_a.jpg"
/3 = "006_m_f_h_b.jpg"
/4 = "007_m_m_h_b.jpg"
</item>

<item NegativeAngry>
/1 = "004_o_m_a_a.jpg"
/2 = "005_o_f_a_b.jpg"
/3 = "006_m_f_a_a.jpg"
/4 = "007_m_m_a_a.jpg"
</item>

<picture PositiveFace>
/ items = PositiveHappy
/ position = (50, 50)
/ size = (40%, 40%)


</picture>

<picture NegativeFace>
/ items = NegativeAngry
/ position = (50, 50)
/ size = (40%, 40%)

</picture>



<text fixation>
/ items = ("+")
/ color = black
</text>

<item BlankScreen>
/1= ""
</item>


<text BlankScreen>
/ items = BlankScreen
</text>


<page welcome>
Welcome to the Experiment 2.
</page>


<page end>
This is the end. Thank you for your participation.
</page>

<instruct>
/ fontstyle = ("Arial", 5%, true)
/ txcolor = black
/ windowsize = (90%, 90%)
/ screencolor = white
</instruct>

<htmlpage CongruentInstruction >
/ file = "In this specific task.htm"
</htmlpage>


<item PositiveInstructionImage>
/1 = "004_o_m_h_b.jpg"
</item>

<picture PositiveInstructionImage>
/ items = PositiveInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item NegativeInstructionImage>
/1 = "004_o_m_a_a.jpg"
</item>

<picture NegativeInstructionImage>
/ items = NegativeInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item VowelI>
/1 = "Bika.wav"
</item>

<sound VowelI>
/ items = VowelI
</sound>

<sound VowelO>
/ items = VowelO
</sound>

<item VowelO>
/1 = "Boka.wav"
</item>

<trial PreInstCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelI; 4500=NegativeInstructionImage; 5500=sound.VowelO ]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial PreInstInCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelO; 4500=NegativeInstructionImage; 5500=sound.Voweli]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial CongruentPositive>
/stimulustimes = [0 =fixation; 500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial CongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentPositive>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000
</trial>

<block Block0>
/ trials = [1-2= noreplace(PreInstCong, PreInstInCong)]
/ preinstructions = (htmlpage.CongruentInstruction)
/ postinstructions = ()
</block>

<block Block1>
/ trials = [1-4= noreplace(CongruentPositive, CongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>

<block Block2>
/ trials = [1-4= noreplace(IncongruentPositive, IncongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>


<expt>
/ blocks = [1=Block0; 2=Block1; 3=Block2]
/ preinstructions = (page.welcome)
/ postinstructions = (page.end)

/onexptend = [values.completed = 1]
</expt>



> However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between the stimulus onset (presentation of faces) and the first utterance by the participants.

That's what the code does, and it's working fine for me. If it doesn't on your system, that's probably an issue with the soundcard or microphone. How well voicerecord works varies greatly between systems and particular hardware.

You can fidlle around with different voicekeythreshold  ( https://www.millisecond.com/support/docs/v5/html/language/attributes/voicekeythreshold.htm ) settings to try and find the correct trip level for your hardware. Make sure your microphone is placed properly, and try a different sound interface if you have one available (external ones are often better than the cheap chipsets found in many PCs or laptops).

Saru
Saru
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)
Group: Forum Members
Posts: 4, Visits: 32
Dave - 4/30/2024
Saru - 4/30/2024
Hi,

I am currently trying to program an experiment that records the verbal response provided by the participants. I used the /inputdevice = voice record one and it does record the response and also stores recordings. However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between  the stimulus onset (presentation of faces) and the first utterance by the participants.  I am a beginner in Inquisit and i am not sure what can be done for this. Could you please help me with this?

<defaults>
/minimumversion = "4.0.2.0"
/ fontstyle = ("Arial", 6.00%, true, false, false, false, 5, 1)

</defaults>

<values>
/completed = 0
</values>

<item PositiveHappy>
/1 = "004_o_m_h_b.jpg"
/2 = "005_o_f_h_a.jpg"
/3 = "006_m_f_h_b.jpg"
/4 = "007_m_m_h_b.jpg"
</item>

<item NegativeAngry>
/1 = "004_o_m_a_a.jpg"
/2 = "005_o_f_a_b.jpg"
/3 = "006_m_f_a_a.jpg"
/4 = "007_m_m_a_a.jpg"
</item>

<picture PositiveFace>
/ items = PositiveHappy
/ position = (50, 50)
/ size = (40%, 40%)


</picture>

<picture NegativeFace>
/ items = NegativeAngry
/ position = (50, 50)
/ size = (40%, 40%)

</picture>



<text fixation>
/ items = ("+")
/ color = black
</text>

<item BlankScreen>
/1= ""
</item>


<text BlankScreen>
/ items = BlankScreen
</text>


<page welcome>
Welcome to the Experiment 2.
</page>


<page end>
This is the end. Thank you for your participation.
</page>

<instruct>
/ fontstyle = ("Arial", 5%, true)
/ txcolor = black
/ windowsize = (90%, 90%)
/ screencolor = white
</instruct>

<htmlpage CongruentInstruction >
/ file = "In this specific task.htm"
</htmlpage>


<item PositiveInstructionImage>
/1 = "004_o_m_h_b.jpg"
</item>

<picture PositiveInstructionImage>
/ items = PositiveInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item NegativeInstructionImage>
/1 = "004_o_m_a_a.jpg"
</item>

<picture NegativeInstructionImage>
/ items = NegativeInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item VowelI>
/1 = "Bika.wav"
</item>

<sound VowelI>
/ items = VowelI
</sound>

<sound VowelO>
/ items = VowelO
</sound>

<item VowelO>
/1 = "Boka.wav"
</item>

<trial PreInstCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelI; 4500=NegativeInstructionImage; 5500=sound.VowelO ]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial PreInstInCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelO; 4500=NegativeInstructionImage; 5500=sound.Voweli]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial CongruentPositive>
/stimulustimes = [0 =fixation; 500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial CongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentPositive>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000
</trial>

<block Block0>
/ trials = [1-2= noreplace(PreInstCong, PreInstInCong)]
/ preinstructions = (htmlpage.CongruentInstruction)
/ postinstructions = ()
</block>

<block Block1>
/ trials = [1-4= noreplace(CongruentPositive, CongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>

<block Block2>
/ trials = [1-4= noreplace(IncongruentPositive, IncongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>


<expt>
/ blocks = [1=Block0; 2=Block1; 3=Block2]
/ preinstructions = (page.welcome)
/ postinstructions = (page.end)

/onexptend = [values.completed = 1]
</expt>



> However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between the stimulus onset (presentation of faces) and the first utterance by the participants.

That's what the code does, and it's working fine for me. If it doesn't on your system, that's probably an issue with the soundcard or microphone. How well voicerecord works varies greatly between systems and particular hardware.

You can fidlle around with different voicekeythreshold  ( https://www.millisecond.com/support/docs/v5/html/language/attributes/voicekeythreshold.htm ) settings to try and find the correct trip level for your hardware. Make sure your microphone is placed properly, and try a different sound interface if you have one available (external ones are often better than the cheap chipsets found in many PCs or laptops).

Thankyou so much. It works fine now :)
Saru
Saru
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)
Group: Forum Members
Posts: 4, Visits: 32
Dave - 4/30/2024
Saru - 4/30/2024
Hi,

I am currently trying to program an experiment that records the verbal response provided by the participants. I used the /inputdevice = voice record one and it does record the response and also stores recordings. However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between  the stimulus onset (presentation of faces) and the first utterance by the participants.  I am a beginner in Inquisit and i am not sure what can be done for this. Could you please help me with this?

<defaults>
/minimumversion = "4.0.2.0"
/ fontstyle = ("Arial", 6.00%, true, false, false, false, 5, 1)

</defaults>

<values>
/completed = 0
</values>

<item PositiveHappy>
/1 = "004_o_m_h_b.jpg"
/2 = "005_o_f_h_a.jpg"
/3 = "006_m_f_h_b.jpg"
/4 = "007_m_m_h_b.jpg"
</item>

<item NegativeAngry>
/1 = "004_o_m_a_a.jpg"
/2 = "005_o_f_a_b.jpg"
/3 = "006_m_f_a_a.jpg"
/4 = "007_m_m_a_a.jpg"
</item>

<picture PositiveFace>
/ items = PositiveHappy
/ position = (50, 50)
/ size = (40%, 40%)


</picture>

<picture NegativeFace>
/ items = NegativeAngry
/ position = (50, 50)
/ size = (40%, 40%)

</picture>



<text fixation>
/ items = ("+")
/ color = black
</text>

<item BlankScreen>
/1= ""
</item>


<text BlankScreen>
/ items = BlankScreen
</text>


<page welcome>
Welcome to the Experiment 2.
</page>


<page end>
This is the end. Thank you for your participation.
</page>

<instruct>
/ fontstyle = ("Arial", 5%, true)
/ txcolor = black
/ windowsize = (90%, 90%)
/ screencolor = white
</instruct>

<htmlpage CongruentInstruction >
/ file = "In this specific task.htm"
</htmlpage>


<item PositiveInstructionImage>
/1 = "004_o_m_h_b.jpg"
</item>

<picture PositiveInstructionImage>
/ items = PositiveInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item NegativeInstructionImage>
/1 = "004_o_m_a_a.jpg"
</item>

<picture NegativeInstructionImage>
/ items = NegativeInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item VowelI>
/1 = "Bika.wav"
</item>

<sound VowelI>
/ items = VowelI
</sound>

<sound VowelO>
/ items = VowelO
</sound>

<item VowelO>
/1 = "Boka.wav"
</item>

<trial PreInstCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelI; 4500=NegativeInstructionImage; 5500=sound.VowelO ]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial PreInstInCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelO; 4500=NegativeInstructionImage; 5500=sound.Voweli]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial CongruentPositive>
/stimulustimes = [0 =fixation; 500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial CongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentPositive>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000
</trial>

<block Block0>
/ trials = [1-2= noreplace(PreInstCong, PreInstInCong)]
/ preinstructions = (htmlpage.CongruentInstruction)
/ postinstructions = ()
</block>

<block Block1>
/ trials = [1-4= noreplace(CongruentPositive, CongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>

<block Block2>
/ trials = [1-4= noreplace(IncongruentPositive, IncongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>


<expt>
/ blocks = [1=Block0; 2=Block1; 3=Block2]
/ preinstructions = (page.welcome)
/ postinstructions = (page.end)

/onexptend = [values.completed = 1]
</expt>



> However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between the stimulus onset (presentation of faces) and the first utterance by the participants.

That's what the code does, and it's working fine for me. If it doesn't on your system, that's probably an issue with the soundcard or microphone. How well voicerecord works varies greatly between systems and particular hardware.

You can fidlle around with different voicekeythreshold  ( https://www.millisecond.com/support/docs/v5/html/language/attributes/voicekeythreshold.htm ) settings to try and find the correct trip level for your hardware. Make sure your microphone is placed properly, and try a different sound interface if you have one available (external ones are often better than the cheap chipsets found in many PCs or laptops).

Hi Dave,
So now i have another issue with the voice record. I tried to set up my computer sound system to solve this issue. So far i kept the /voicekeythreshold = 3 and the /inputdevice= voice record. I am using a headset with  attached microphone. When i set the input volume to 65 or more, the trials end abruptly and i get either very short latency like less than 120 ms (the trial ends after onset of stimulus + 1300 ms) or no latency at all and recordings like this https://drive.google.com/drive/folders/1bCZ3SenDnX32ouyrC97hfhx3IW6ZiAxA?usp=drive_link .  The recording here is weird as it did not record the complete response which is just a vowel and not even a word.
When i keep the input volume to 50 and still /voicekeythreshold = 3 and speak out really loud almost shout then the voice record works fine. But i cannot tell each participant everytime to shout as i have a lot of trials, so do you have any solution for this? i have been struggling with this for atleast a week now, i can send you the code if needed.



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 101K
Saru - 6/11/2024
Dave - 4/30/2024
Saru - 4/30/2024
Hi,

I am currently trying to program an experiment that records the verbal response provided by the participants. I used the /inputdevice = voice record one and it does record the response and also stores recordings. However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between  the stimulus onset (presentation of faces) and the first utterance by the participants.  I am a beginner in Inquisit and i am not sure what can be done for this. Could you please help me with this?

<defaults>
/minimumversion = "4.0.2.0"
/ fontstyle = ("Arial", 6.00%, true, false, false, false, 5, 1)

</defaults>

<values>
/completed = 0
</values>

<item PositiveHappy>
/1 = "004_o_m_h_b.jpg"
/2 = "005_o_f_h_a.jpg"
/3 = "006_m_f_h_b.jpg"
/4 = "007_m_m_h_b.jpg"
</item>

<item NegativeAngry>
/1 = "004_o_m_a_a.jpg"
/2 = "005_o_f_a_b.jpg"
/3 = "006_m_f_a_a.jpg"
/4 = "007_m_m_a_a.jpg"
</item>

<picture PositiveFace>
/ items = PositiveHappy
/ position = (50, 50)
/ size = (40%, 40%)


</picture>

<picture NegativeFace>
/ items = NegativeAngry
/ position = (50, 50)
/ size = (40%, 40%)

</picture>



<text fixation>
/ items = ("+")
/ color = black
</text>

<item BlankScreen>
/1= ""
</item>


<text BlankScreen>
/ items = BlankScreen
</text>


<page welcome>
Welcome to the Experiment 2.
</page>


<page end>
This is the end. Thank you for your participation.
</page>

<instruct>
/ fontstyle = ("Arial", 5%, true)
/ txcolor = black
/ windowsize = (90%, 90%)
/ screencolor = white
</instruct>

<htmlpage CongruentInstruction >
/ file = "In this specific task.htm"
</htmlpage>


<item PositiveInstructionImage>
/1 = "004_o_m_h_b.jpg"
</item>

<picture PositiveInstructionImage>
/ items = PositiveInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item NegativeInstructionImage>
/1 = "004_o_m_a_a.jpg"
</item>

<picture NegativeInstructionImage>
/ items = NegativeInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item VowelI>
/1 = "Bika.wav"
</item>

<sound VowelI>
/ items = VowelI
</sound>

<sound VowelO>
/ items = VowelO
</sound>

<item VowelO>
/1 = "Boka.wav"
</item>

<trial PreInstCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelI; 4500=NegativeInstructionImage; 5500=sound.VowelO ]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial PreInstInCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelO; 4500=NegativeInstructionImage; 5500=sound.Voweli]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial CongruentPositive>
/stimulustimes = [0 =fixation; 500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial CongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentPositive>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000
</trial>

<block Block0>
/ trials = [1-2= noreplace(PreInstCong, PreInstInCong)]
/ preinstructions = (htmlpage.CongruentInstruction)
/ postinstructions = ()
</block>

<block Block1>
/ trials = [1-4= noreplace(CongruentPositive, CongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>

<block Block2>
/ trials = [1-4= noreplace(IncongruentPositive, IncongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>


<expt>
/ blocks = [1=Block0; 2=Block1; 3=Block2]
/ preinstructions = (page.welcome)
/ postinstructions = (page.end)

/onexptend = [values.completed = 1]
</expt>



> However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between the stimulus onset (presentation of faces) and the first utterance by the participants.

That's what the code does, and it's working fine for me. If it doesn't on your system, that's probably an issue with the soundcard or microphone. How well voicerecord works varies greatly between systems and particular hardware.

You can fidlle around with different voicekeythreshold  ( https://www.millisecond.com/support/docs/v5/html/language/attributes/voicekeythreshold.htm ) settings to try and find the correct trip level for your hardware. Make sure your microphone is placed properly, and try a different sound interface if you have one available (external ones are often better than the cheap chipsets found in many PCs or laptops).

Hi Dave,
So now i have another issue with the voice record. I tried to set up my computer sound system to solve this issue. So far i kept the /voicekeythreshold = 3 and the /inputdevice= voice record. I am using a headset with  attached microphone. When i set the input volume to 65 or more, the trials end abruptly and i get either very short latency like less than 120 ms (the trial ends after onset of stimulus + 1300 ms) or no latency at all and recordings like this https://drive.google.com/drive/folders/1bCZ3SenDnX32ouyrC97hfhx3IW6ZiAxA?usp=drive_link .  The recording here is weird as it did not record the complete response which is just a vowel and not even a word.
When i keep the input volume to 50 and still /voicekeythreshold = 3 and speak out really loud almost shout then the voice record works fine. But i cannot tell each participant everytime to shout as i have a lot of trials, so do you have any solution for this? i have been struggling with this for atleast a week now, i can send you the code if needed.



That's not something any code can solve, you need to try to balance your recording setup properly. At high input volume, it probably picks up too much noise (breathing on the microphone, clothes rustling, etc.; some sound cards will also have a lot of internal noise, badly shielded cables and wobbly connectors can make things worse, as can driver settings like volume levelng / compression, which will amplify any noise).

Saru
Saru
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)
Group: Forum Members
Posts: 4, Visits: 32
Dave - 6/11/2024
Saru - 6/11/2024
Dave - 4/30/2024
Saru - 4/30/2024
Hi,

I am currently trying to program an experiment that records the verbal response provided by the participants. I used the /inputdevice = voice record one and it does record the response and also stores recordings. However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between  the stimulus onset (presentation of faces) and the first utterance by the participants.  I am a beginner in Inquisit and i am not sure what can be done for this. Could you please help me with this?

<defaults>
/minimumversion = "4.0.2.0"
/ fontstyle = ("Arial", 6.00%, true, false, false, false, 5, 1)

</defaults>

<values>
/completed = 0
</values>

<item PositiveHappy>
/1 = "004_o_m_h_b.jpg"
/2 = "005_o_f_h_a.jpg"
/3 = "006_m_f_h_b.jpg"
/4 = "007_m_m_h_b.jpg"
</item>

<item NegativeAngry>
/1 = "004_o_m_a_a.jpg"
/2 = "005_o_f_a_b.jpg"
/3 = "006_m_f_a_a.jpg"
/4 = "007_m_m_a_a.jpg"
</item>

<picture PositiveFace>
/ items = PositiveHappy
/ position = (50, 50)
/ size = (40%, 40%)


</picture>

<picture NegativeFace>
/ items = NegativeAngry
/ position = (50, 50)
/ size = (40%, 40%)

</picture>



<text fixation>
/ items = ("+")
/ color = black
</text>

<item BlankScreen>
/1= ""
</item>


<text BlankScreen>
/ items = BlankScreen
</text>


<page welcome>
Welcome to the Experiment 2.
</page>


<page end>
This is the end. Thank you for your participation.
</page>

<instruct>
/ fontstyle = ("Arial", 5%, true)
/ txcolor = black
/ windowsize = (90%, 90%)
/ screencolor = white
</instruct>

<htmlpage CongruentInstruction >
/ file = "In this specific task.htm"
</htmlpage>


<item PositiveInstructionImage>
/1 = "004_o_m_h_b.jpg"
</item>

<picture PositiveInstructionImage>
/ items = PositiveInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item NegativeInstructionImage>
/1 = "004_o_m_a_a.jpg"
</item>

<picture NegativeInstructionImage>
/ items = NegativeInstructionImage
/ position = (50, 50)
/ size = (40%, 40%)
</picture>

<item VowelI>
/1 = "Bika.wav"
</item>

<sound VowelI>
/ items = VowelI
</sound>

<sound VowelO>
/ items = VowelO
</sound>

<item VowelO>
/1 = "Boka.wav"
</item>

<trial PreInstCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelI; 4500=NegativeInstructionImage; 5500=sound.VowelO ]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial PreInstInCong>
/ stimulustimes = [0 = text.fixation; 1500 =PositiveInstructionImage; 2500= sound.VowelO; 4500=NegativeInstructionImage; 5500=sound.Voweli]
/ trialduration = 6500
/ inputdevice = keyboard
/ correctresponse = (" ")
</trial>


<trial CongruentPositive>
/stimulustimes = [0 =fixation; 500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial CongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentPositive>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=PositiveFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000

</trial>

<trial IncongruentNegative>
/stimulustimes = [0=fixation;500 = BlankScreen; 1000=NegativeFace]
/ recorddata = true
/ inputdevice = voicerecord
/ validresponse = (anyresponse)
/ trialduration = 3300
/ posttrialpause = 1000
</trial>

<block Block0>
/ trials = [1-2= noreplace(PreInstCong, PreInstInCong)]
/ preinstructions = (htmlpage.CongruentInstruction)
/ postinstructions = ()
</block>

<block Block1>
/ trials = [1-4= noreplace(CongruentPositive, CongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>

<block Block2>
/ trials = [1-4= noreplace(IncongruentPositive, IncongruentNegative)]
/ preinstructions = (htmlpage.CongruentInstruction)
</block>


<expt>
/ blocks = [1=Block0; 2=Block1; 3=Block2]
/ preinstructions = (page.welcome)
/ postinstructions = (page.end)

/onexptend = [values.completed = 1]
</expt>



> However, i am not sure about the latency it provides (in my case all of the trials have same latency). I want the response time (saved as latency if possible) to be time between the stimulus onset (presentation of faces) and the first utterance by the participants.

That's what the code does, and it's working fine for me. If it doesn't on your system, that's probably an issue with the soundcard or microphone. How well voicerecord works varies greatly between systems and particular hardware.

You can fidlle around with different voicekeythreshold  ( https://www.millisecond.com/support/docs/v5/html/language/attributes/voicekeythreshold.htm ) settings to try and find the correct trip level for your hardware. Make sure your microphone is placed properly, and try a different sound interface if you have one available (external ones are often better than the cheap chipsets found in many PCs or laptops).

Hi Dave,
So now i have another issue with the voice record. I tried to set up my computer sound system to solve this issue. So far i kept the /voicekeythreshold = 3 and the /inputdevice= voice record. I am using a headset with  attached microphone. When i set the input volume to 65 or more, the trials end abruptly and i get either very short latency like less than 120 ms (the trial ends after onset of stimulus + 1300 ms) or no latency at all and recordings like this https://drive.google.com/drive/folders/1bCZ3SenDnX32ouyrC97hfhx3IW6ZiAxA?usp=drive_link .  The recording here is weird as it did not record the complete response which is just a vowel and not even a word.
When i keep the input volume to 50 and still /voicekeythreshold = 3 and speak out really loud almost shout then the voice record works fine. But i cannot tell each participant everytime to shout as i have a lot of trials, so do you have any solution for this? i have been struggling with this for atleast a week now, i can send you the code if needed.



That's not something any code can solve, you need to try to balance your recording setup properly. At high input volume, it probably picks up too much noise (breathing on the microphone, clothes rustling, etc.; some sound cards will also have a lot of internal noise, badly shielded cables and wobbly connectors can make things worse, as can driver settings like volume levelng / compression, which will amplify any noise).

Ah okay!  So i will test with other devices as well thankyou so much for quick reply :)

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search