Setting complex sound file name in SoundOut object

Susan G. Campbell scampbell at casl.umd.edu
Mon Jul 31 21:38:55 UTC 2006


Have you considered setting the path as an attribute as well?  That way
you could set the path separately in the list or, say, in the Edit:
Experiment: Startup Info screen.  

I tried setting the SoundOut Filename to [PathName][SoundFileName] and
E-Prime interpreted it correctly, where PathName was the constant
C:\\stimuli\whatever\ and SoundFileName was the name of the wav file.
You could also just put the whole path in SoundFileName, but that could
be problematic if you ever wanted to move the experiment to another
directory.

Hope this helps,
Susan Campbell
Graduate Research Assistant
University of Maryland
Center for Advanced Study of Language

-----Original Message-----
From: eprime at mail.talkbank.org [mailto:eprime at mail.talkbank.org] On
Behalf Of EJ Nikelski
Sent: Monday, July 31, 2006 5:21 PM
To: Subject: Setting complex sound file name in SoundOut object

Hello List,

    I'm a new user, and I've run into a problem that must have a simple 
solution ... although I haven't been able to find it. Specifically, I am

using a SoundOut object to play a wav file for each trial; the wav file 
to be played is defined as a trial attribute in the trial list. If I set

the SoundOut object Filename field to [prime], there is no problem.

    However, when I place my wav files in a separate directory, and I 
set the SoundOut Filename to something like 
"C:\stimuli\auditory\[prime]", I get a compile error at the following
line:

primeSoundBuffer.Filename = C:\\stimuli\\auditory\[prime")


   Note that the line of code has been corrupted (double backslash on 
the end missing, double quote inserted, square bracket changed to right 
parenthesis). I've tried a few variations on this, but the only thing 
that I have gotten working is (1) a completely fixed path wav filename, 
and (2) using only the attribute -- which forces all of the wav files to

be located in my experimental directory.

   I've run out of ideas. Any help would be very appreciated.


Thanks,


-Jim


-- 
Jim Nikelski, Ph.D.
Postdoctoral Research Fellow
Bloomfield Centre for Research in Aging
Lady Davis Institute for Medical Research
Sir Mortimer B. Davis - Jewish General Hospital
McGill University
Tel: (514) 340-8222 x 2298
Fax: (514) 340-8295



More information about the Eprime mailing list