assign a preloaded soundbuffer to the soundbuffer of a SoundOut object?

157 views
Skip to first unread message

Emiliano Díez

unread,
Oct 1, 2013, 7:36:09 AM10/1/13
to e-p...@googlegroups.com
Hi all,

I need to assign a soundbuffer that has been preloaded into memory to the soundbuffer of a SoundOut object in a procedure. Can this be done???

The point is that my procedure needs to play a video playing and at the same time to present several sounds (sentences in this case) and record reaction times to these sounds. If I use mybuffer.load while the video is playing a small pause of the video can be seen. So my solution was to make an array of soundbuffers and play them with inline code. But in this way I lost the possibility to record the key responses in the way I need (need to know if the keypress, that starts with the onset of each sound, has been ocurred before or after the sound ends). I have found a way to do this, but need to have a  soundobject and a wait object. So the question: is it possible to assign a preloaded soundbuffer to the sound buffer of a soundobject?

Thanks all


David McFarlane

unread,
Oct 1, 2013, 9:32:16 AM10/1/13
to e-p...@googlegroups.com
I do not have an answer to your question as
posed, but I would like to pose the
following. What version of E-Prime do you
use? If you use EP2.0.10.x or later, try setting
GeneratePreRun on your Procedure to
TopOfProcedure, then use a separate SoundOut
object for each of your sounds during the
movie. With TopOfProcedure, all the
SoundBuffer.Load operations will take place at
the beginning of the Procedure, not during your
movie playback, and perhaps that would solve your
problem. It would also eliminate the need for messy inline code.

And if you do not use EP2.0.10.x, well, maybe this is your reason to upgrade.

-----
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster)

/----
Stock reminder: 1) I do not work for PST. 2)
PST's trained staff take 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, so make full use of it. 3) In
addition, PST offers several instructional videos
on their YouTube channel
(http://www.youtube.com/user/PSTNET ). 4) If you
do get an answer from PST staff, please extend
the courtesy of posting their reply back here for the sake of others.
\----

Emiliano Díez

unread,
Oct 4, 2013, 12:04:58 PM10/4/13
to e-p...@googlegroups.com
Thanks David

I am using EP2.0.10.242. Your solution sure will work for the "video/sound part" of the problem. But also I have to record reaction time to the sounds and to know if that reaction times occur before or after the end each sound. That is the point where I needed the sound object. But think I have found a solution using a Do While-Loop and a wait object of 0 duration just after the inline that plays the cached sound. Also, I prefer not to have several objects for the same funcionality if not totally necessary (in this case I prefer messy inline code).

Thanks again for your suggestion
Reply all
Reply to author
Forward
0 new messages