pre-loading items in Slide object

1,368 views
Skip to first unread message

terhi helminen

unread,
Dec 2, 2012, 3:36:56 PM12/2/12
to e-p...@googlegroups.com

Hi,

I have tried to preload soundfiles and moviefiles of a slide object in the beginning of the trial to decrease timing delay. (I can't use prerelease in my experiment.)

I found a good example of preloading stimuli from http://imaging.mrc-cbu.cam.ac.uk/imaging/EprimeTiming :

----

This example shows how to preload soundfiles:

'Get the soundbuffer from the soundout object
Dim SBuffer as SoundBuffer
Set SBuffer = SoundOut1.Buffers(1)

'Assign the new filename (where Stimulus is name of attribute on list that lists sound files)
SBuffer.Filename = c.GetAttrib("Stimulus")

'Instruct the object to load the sound contents into its internal structures
SoundOut1SoundBuffer.Load 

And here’s how to preload images:

'Retrieve the image filename from the Context
Dim strImageFileName As String
strImageFileName = c.GetAttrib("imagefilename")

'Assign the new filename and instruct the object
'to load the image
ImageDisplay1.Filename = strImageFileName
ImageDisplay1.Load

---

However, I didn't succeed in doing the same when the sound file and the movie files are subobjects of a slide object. Could somebody help me with this? Thank you in advance!

Terhi

David McFarlane

unread,
Dec 3, 2012, 2:45:28 PM12/3/12
to e-p...@googlegroups.com
Terhi,

Start by looking at the SlideSoundOut and SoundBuffer topics in the
E-Basic Help facility. Then look at the "Load Image Upon Mouse
Click" example from the Samples area of the PST website, I think that
will show the mechanics of how to access Slide sub-objects. Then
take it from there.

-----
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 -- this is pretty
much their substitute for proper documentation, 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.
\----


At 12/2/2012 03:36 PM Sunday, you wrote:
>I have tried to preload soundfiles and moviefiles of a slide object
>in the beginning of the trial to decrease timing delay. (I can't use
>prerelease in my experiment.)
>
>I found a good example of preloading stimuli from
><http://imaging.mrc-cbu.cam.ac.uk/imaging/EprimeTiming>http://imaging.mrc-cbu.cam.ac.uk/imaging/EprimeTiming

Mich

unread,
Dec 4, 2012, 8:13:49 AM12/4/12
to e-p...@googlegroups.com

Hi,

To start with, i have no idea, but i would suggest, if you must go this way, to look up how to set other subobjects of slides. With all the "set" manoeuvres and tons of code, I try to avoid. But once you're able to attach a different sound to your slide, you should be able to preload it.

1) While it is true that pre-loading can be of use, I believe having a sound object (like a soundout device, etc), will automatically add the preloading bit.

2) have you actually checked to see whether the timing errors are to worry about?

3) it should be possible to have sub-millisecond accurate simultaneous audio and video WHILST they are sequentially placed in the procedure. To do this, just add a sound before your slide, set its duration (and don't use sync), to 0, and make sure it continues playing after the soundout thing stops. If there's a timing error, you can easily add x microseconds of silence at the beginning of the sound file. Presto!

 

You might get better results from using uncompressed audio and video files, though, and if the timing delay is really stable, you could always make the preceding interval smaller.

Best,

Michiel

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-p...@googlegroups.com.
To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

David McFarlane

unread,
Dec 4, 2012, 10:22:38 AM12/4/12
to e-p...@googlegroups.com
Terhi,

Come to think of it, if you have EP2.0.10.242, then setting the new
GeneratePreRun feature to TopOfProcedure (the default value) does
exactly what you asked (pre-load Slide sub-objects at start of
Procedure) automatically. If you have not already, this may make it
worth your while to upgrade, but beware of all the new features &
gotchas of the new version (see
http://www.pstnet.com/support/kb.asp?TopicID=5345 for a few hints).

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


At 12/3/2012 02:45 PM Monday, David McFarlane wrote:
>Terhi,
>
>Start by looking at the SlideSoundOut and SoundBuffer topics in the
>E-Basic Help facility. Then look at the "Load Image Upon Mouse
>Click" example from the Samples area of the PST website, I think
>that will show the mechanics of how to access Slide
>sub-objects. Then take it from there.
>
>-----
>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 -- this is pretty
>much their substitute for proper documentation, 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.
>\----
>
>
>At 12/2/2012 03:36 PM Sunday, you wrote:
>>I have tried to preload soundfiles and moviefiles of a slide object
>>in the beginning of the trial to decrease timing delay. (I can't
>>use prerelease in my experiment.)
>>
>>I found a good example of preloading stimuli from
>><http://imaging.mrc-cbu.cam.ac.uk/imaging/EprimeTiming>http://imaging.mrc-cbu.cam.ac.uk/imaging/EprimeTiming
Reply all
Reply to author
Forward
0 new messages