Audio + Movie together

500 views
Skip to first unread message

Theodore Teow

unread,
Nov 4, 2014, 10:11:29 PM11/4/14
to e-p...@googlegroups.com
Hi all, I've got a question about playing a list of audio stimuli while having a movie playing throughout the experiment.

It's an EEG experiment that is passively responded to via EEG signals, so no physical response is required.

My question is how we create a slide that allows for a list of, say, 999 auditory sound trials to be played while a movie is constantly shown?

Currently, I can only create a slide where the movie plays and the first auditory sound trial is played. I'd like the rest of the list to play after.

Thanks for your help!

David McFarlane

unread,
Nov 5, 2014, 1:58:17 PM11/5/14
to e-p...@googlegroups.com
Try the following and see if it works:

Set up your movie Procedure something like

SessionProc
MovieSlide
TrialList
TrialProc
StimSound

MovieSlide contains your SlideMovie sub-object, and set the Stop
After on that to "No". That should allow the movie to keep playing
while the rest of the program runs. Set the Duration of MovieSlide
to 0 if you want the sounds to start playing right after the movie
starts, or add some Duration in order to impose a delay before the
first sound. Then TrialList holds your sound stimuli, and StimSound
should play each sound while the movie continues to play.

-----
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) You may reach PST's
trained staff (and other support facilities) at
https://support.pstnet.com . 3) If you do get an answer from PST
staff, please extend the courtesy of posting their reply back here
for the sake of others.
\----
Message has been deleted

Theodore Teow

unread,
Nov 6, 2014, 4:08:15 AM11/6/14
to e-p...@googlegroups.com
David McFarlane, you are one of (if not) the most active helper(s) on this forum - thank you.

I've tried doing as you've suggested, with decent success. I've encountered a situation where the sounds continue to play over the movie, but the movie stops after less than a minute. This is despite the sound continuing to play; I set duration of the MovieSlide to five seconds with Stop After set to "No". Any thoughts on why that would be the case?

Cheers,
Theodore

David McFarlane

unread,
Dec 12, 2014, 10:49:01 AM12/12/14
to e-p...@googlegroups.com
For the record, back on 10 Nov 2014 I sent a
reply with an attachment to Theodore off the
Group, along with some explanation. Here is what I said:

Theodore,

You flatter me. We might also mention Michiel
Sovijärvi-Spapé, Paul Groot, and Ben Robinson
(among others) as frequent & valuable contributors to the Group.

I decided to give this a try myself, so I mocked
up a little demo that plays a couple of short
movies while playing a List of sounds, please see
attached. Note that I set PreRelease to 0 in a
couple of places, to avoid problems of reloading
the next movie or sound while the current one plays.

The technique works, sort of. I seem to notice
the movie pausing slightly at the start of each
sound file. And then, at about the fifth or
sixth movie, I get the following runtime error:

/--------------------------
---------------------------
Runtime Error!
---------------------------
The following runtime error occurred:

Unable to communicate with thread that fills the sound buffer contents
Extra1: 110250
Extra2: 0
Extra3: 6733787
Extra4: No
Extra5: 14848


Line: 535
Error Number: 18031
---------------------------
OK
---------------------------
\--------------------------

So maybe E-Prime is just not meant for this type
of use, at least not using normal
techniques. Beyond that, if you looked at the
code generated by E-Studio then you might find a
way to write up some inline code that would
preload all the sound files, avoid the pausing & runtime error, etc.

At this point you might submit a request to PST
to learn more (and tell them that you already
talked to me). I would be interested to learn how this all turns out for you.

Regards,
-- dkm
---------------
David McFarlane, Systems Designer
Dept. Psychology, Michigan State University
E-Prime training online: psychology.msu.edu/Workshops_Courses/eprime.aspx
><http://psychology.msu.edu/Workshops_Courses/eprime.aspx>http://psychology.msu.edu/Workshops_Courses/eprime.aspx
>
>Twitter: @EPrimeMaster
>(<https://twitter.com/EPrimeMaster>https://twitter.com/EPrimeMaster)
>
>/----
>Stock reminder: 1) I do not work for PST. 2) You may reach PST's
>trained staff (and other support facilities) at
><https://support.pstnet.com>https://support.pstnet.com

noa albelda

unread,
Apr 26, 2015, 10:52:33 AM4/26/15
to e-p...@googlegroups.com
Hi all,

I was having the same issues with playing movie and sounds in parallel and I also got it to play and then crash after a while with the same error message ("unable to communicate..." etc.). This is the reply I got from PST support (haven't tried it yet):

As per the error you're receiving, I recommend running your files through Codec Config to set up the codecs for E-Prime to use. For more information about Codec Config, please see 3162 - FEATURE: CodecConfig provides ability to choose codecs used for Movie and Sound rendering. The Knowledge Base topic contains a video that explains Codec Config in great detail. Note that to maximize the functionality of both E-Prime and Codec Config, you should install a comprehensive codec package such as K-Lite Mega Codec Pack and the latest version of DivX. After installing the appropriate codecs, open Codec Config through the Start menu or through E-Studio's Tools menu. Select "Create Default Mappings" from the Codec Config Tools menu, then click the first option button. This will set up the mappings that are most likely to work on your machine. Next, select Render File... from the File menu, find one of your audio files and click Open. If you receive errors, please try rendering it again until you see only warnings or success.

I also recommend importing your audio file(s) into Graph-Studio-Next. This is a program that essentially shows the 'flow' of an audio/video file, and can help determine exactly what codecs are needed and are used in playback and output. I also recommending viewing 3162 - FEATURE: CodecConfig provides ability to choose codecs used for Movie and Sound rendering once again. This video demonstrating Codec Config has an excellent tutorial on using Graph-Studio-Next for use with CodecConfig.

I also recommend verifying that you have the most up-to-date version of your audio drivers installed. To do this, first navigate to your Start menu > Run > dxdiag.exe ... This will start the DirectX Diagnostic Tool. This is a diagnostics tool used to test DirectX functionality and troubleshoot video- or sound-related hardware problems Next, click the 'Sound' tab. This will present you with information regarding the manufacturer of the hardware as well as the actual device. Notice on the left of this screen the 'Drivers' section. This shows information regarding the drivers used for this hardware, as well as the date they were last updated. Take note of all of this information.

Next, navigate to your Start menu > Control Panel > Hardware & Sound > Device Manager. Find the 'Sound, video, and game controllers' item from the list. You will notice that your hardware which you saw in the DirectX Diagnostic Tool is listed here. Right-click your hardware > Update driver software. Alternatively, you can navigate to the manufacturer's website and manually download/install the driver from their site. 
Message has been deleted

looking for answers

unread,
Aug 20, 2018, 11:39:23 AM8/20/18
to E-Prime
Hi David, 

I encountered the same issue as Theodore and I would like to thank you for your valuable answer. 

The link that appears at your signature (http://psychology.msu.edu/Workshops_Courses/eprime.aspx) seems outdated. Is there any other link where we can find your E-prime courses?

Thank you!!

David McFarlane

unread,
Aug 20, 2018, 5:06:59 PM8/20/18
to e-p...@googlegroups.com, looking for answers
Glad that helped. Please see the updated link to the course below.
Also note that the course has not been updated for E-Prime 3, but if you
use EP2 it should still be helpful.

(And in case anyone else stumbles on this message, please note that
further down in that thread it turns out that my answer here turned out
not to work as well as it should.)

---------------
David McFarlane
E-Prime® 2.0 training online:
psychology.msu.edu/workshop-and-additional-course/e-prime-introduction-to-programming-computerized-behavioral-tasks
Twitter: @EPrimeMaster (twitter.com/EPrimeMaster)


On 2018-08-20 11:38 AM, looking for answers wrote:
> Hi David,
>
> I encountered the same issue as Theodore and I would like to thank you for
> your valuable answer.
>
> The link that appears at your signature (
> psychology.msu.edu/Workshops_Courses/eprime.aspx)
> seems outdated. Is there any other link where we can find your E-prime
> courses?
>
> Thank you!!
>
>
>
> Τη Τετάρτη, 5 Νοεμβρίου 2014 - 7:58:17 μ.μ. UTC+1, ο χρήστης McFarlane,
> David έγραψε:
>>
>> Try the following and see if it works:
>>
>> Set up your movie Procedure something like
>>
>> SessionProc
>> MovieSlide
>> TrialList
>> TrialProc
>> StimSound
>>
>> MovieSlide contains your SlideMovie sub-object, and set the Stop
>> After on that to "No". That should allow the movie to keep playing
>> while the rest of the program runs. Set the Duration of MovieSlide
>> to 0 if you want the sounds to start playing right after the movie
>> starts, or add some Duration in order to impose a delay before the
>> first sound. Then TrialList holds your sound stimuli, and StimSound
>> should play each sound while the movie continues to play.
>>
>> -----
>> David McFarlane
>> E-Prime training
>> online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
>> Twitter: @EPrimeMaster (https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_EPrimeMaster&d=DwIFaQ&c=nE__W8dFE-shTxStwXtp0A&r=rVCe0bDlnqQHHAg2cizkHg&m=dZ1yykyYMwO1XNjrf2jNHkcCC9tXMUGA4-Qt4X1Gla8&s=M3FRhd_t-8_rs6QqSDZVxC7p0jD6WYFFAXX_RAxSV_o&e=)
>>
>> /----
>> Stock reminder: 1) I do not work for PST. 2) You may reach PST's
>> trained staff (and other support facilities) at
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__support.pstnet.com&d=DwIFaQ&c=nE__W8dFE-shTxStwXtp0A&r=rVCe0bDlnqQHHAg2cizkHg&m=dZ1yykyYMwO1XNjrf2jNHkcCC9tXMUGA4-Qt4X1Gla8&s=DsLUnnjAoUV4uJiF3bt-Icn2vLWY3puWTi5-LsG3B5Q&e= . 3) If you do get an answer from PST

looking for answers

unread,
Sep 19, 2018, 11:26:00 AM9/19/18
to E-Prime
Hi, 

something strange happens and I cannot explain what is wrong. 
As David suggested above I have made a MovieSlide to present a movie simultaneously with auditory stimuli (from a text file). 
When all audio stimuli are presented, we can watch the movie for 2-3 sec more and then the experiment terminates abruptly without executing all the subsequent objects. 
- It does print out debug messages that are placed after the movieSlide+sounOut objects, so inline code works well
- it does not display the text (Goodbye) from textDisplay object. 

Do you have any idea what might be wrong? 

In a previous version of the experiment where the SoundOut object didn't take any response from the participant everything went ok. 

Any ideas will be greatly appreciated! 
Thank you!!

looking for answers

unread,
Sep 19, 2018, 11:53:10 AM9/19/18
to E-Prime
Hi again, 

I think I resolved the issue. 
Actually, I understood that the movie keeps playing till the end of the experiment since I haven't specified a Stop Position. So, the movie was masking the Thank you + Good Bye message that was displayed behind it. 
After setting the Stop Position = Total duration of audio stimuli  and adding 2000 ms of Wait I could see the Good Bye + Thank you messages. 

If you think that this is not the proper way to end a movie that is displayed along some audio stimuli please do not hesitate to propose a better solution. 

Thank you for your time!!!
Reply all
Reply to author
Forward
0 new messages