SRBOX speech input trigger
David McFarlane
mcfarla9 at msu.edu
Tue Jun 28 15:51:00 UTC 2011
Baris,
Stock reminder: 1) I do not work for PST. 2) PST's trained staff
takes any and all questions at
http://support.pstnet.com/e%2Dprime/support/login.asp , and they
strive to respond to all requests in 24-48 hours -- this is pretty
much their substitute for proper documentation, so make full use of
it. 3) If you do get an answer from PST Web Support, please extend
the courtesy of posting their reply back here for the sake of others.
That said, here is my take...
You have three issues mixed together here:
1) Sending a signal to external equipment following a response.
2) Using the SRBox for a response.
3) Using the SRBox as a voicekey.
I like to think that you have sorted 2 & 3; if not, first heed Mich's
advice to start small and work up from there. OTOH I am puzzled by
your statement that "it writes the onset time of the speech as
'0'". That makes no sense. Onset times are in ms from the start of
the session, so it is completely impossible to get onset times of
0. Perhaps you meant something else?
But on to issue 1. By "we have an e-prime object waiting for the
speech input from SRBOX" do you mean that your stimulus object (let's
call it StimSlide) has a Duration of (infinite) and End Action
Terminate (i.e., a self-paced stimulus terminated only by voice
response)? And you want to send the same signal to your external
device whenever the subject responds? If so, you might use the
OnsetSignal... and OffsetSignal... properties. I would set this up
using inline code at the start of the program, something like
Const Lpt1Port as Integer = &h0378 ' adjust to match your system
Const RespSignal as Integer = &hFF ' adjust for your signal
StimSlide.OnsetSignalPort = Lpt1Port
StimSlide.OnsetSignalData = 0 ' reset output at start of stimulus
StimSlide.OnsetSignalEnabled = True
StimSlide.OffsetSignalPort = Lpt1Port
StimSlide.OffsetSignalData = RespSignal
StimSlide.OffsetSignalEnabled = True
You can learn more about these properties by looking up the
appropriate topics in the E-Basic Help facility. StimSlide will now
send the RespSignal at its offset, which happens as soon as it gets a
response. Note that I set OnsetSignalData to 0 -- RespSignal stays
on the output port until something else replaces it, here I use the
OnsetSignal to reset the port, you could also use other means.
But suppose your stimulus has a time limit, so that it might
terminate without a response, and you want a signal only in the case
of a response. In that case you might skip all the
Onset/OffsetSignal... stuff above, and do something like the
following in inline code right after your stimulus:
Const Lpt1Port as Integer = &h0378 ' adjust to match your system
Const RespSignal as Integer = &hFF ' adjust for your signal
Const SignalDur as Long = 10
If (StimSlide.RT > 0) Then
WritePort Lpt1Port, RespSignal
Sleep SignalDur
WritePort Lpt1Port, 0 ' reset output
End If
(This uses .RT to detect a response, for other options see my
comments at
http://groups.google.com/group/e-prime/browse_thread/thread/5e712b8b726ea0de/798ed4c44b6c44e3
.)
For more discussion on this, and a solution to a more complex
scenario (sending signal at time of response while letting the
stimulus continue its Duration), see threads at
http://groups.google.com/group/e-prime/browse_thread/thread/abec5564c65de738
and
http://groups.google.com/group/e-prime/browse_thread/thread/cfc3d0307d5c7fbd
(which you could have found by doing a search using terms like "OnsetSignal").
-- David McFarlane, Professional Faultfinder
"For a successful technology, reality must take precedence over
public relations, for nature cannot be fooled." (Richard Feynman,
Nobel prize-winning physicist)
>Dear E-prime users,
>
>In our script, we have an e-prime object waiting for the speech
>input from SRBOX (with input key defined as "6"). We want to write
>an inline code (without jump) to make it possible to send a trigger
>as soon as the speech input is recognized. We do not want to use
>jump , becasue after this object there are things which should be
>executed. How do we write an inline script call like "If
>SRBOX.activated=TRUE, then WritePort.. " kind of description?
>
>Also, in our tests, eventhough we increased the sensitivity of the
>SRBOX for speech input it writes the onset time of the speech as
>"0", I wonder there is something that we are missing...any suggestions?
>
>Thank you for your help in advance,
>Baris
>
>--
>SB Demiral, PhD.
>Department of Psychology
>7 George Square
>The University of Edinburgh
>Edinburgh, EH8 9JZ
>UK
>Phone: +44 (0131) 6503063
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
More information about the Eprime
mailing list