Button press during sound play

Michiel Spape Michiel.Spape at nottingham.ac.uk
Thu May 20 16:35:09 UTC 2010


Hi Melissa, David &al.,

Is this solved yet? As I just happen to have an experiment open which does this sort of stuff, I was just thinking that in situations where you would like a sound to stop playing, the easiest way, by far, seems to be
mySoundBuffer.Stop
...

That's one serious bit of code, hmm? Of course, that is given that you have pre-programmed this SoundBuffer, for example:
1. put this in the User Script (alt+5, tab user)
Dim GenericSoundBufferInfo As SoundBufferInfo 
2. And put this in a little inline at the beginning of your experiment
GenericSoundBufferInfo.MaxLength = 100   'where 100 is the maximum duration your sample could possibly be... in my case 100 ms (my samples are 30 ms, actually)
GenericSoundBufferInfo.VolumeControl = CLogical("No")
GenericSoundBufferInfo.PanControl = CLogical("No")
Set mySoundBuffer = Sound.CreateBuffer(GenericSoundBufferInfo) 
mySoundBuffer.Filename ="tap30ms.wav"    'where tap30ms.wav is actually my 30 ms sound file of a... tap
mySoundBuffer.Load

3. Put the following inline anywhere you'd like to play the sound
mySoundBuffer.Play
4. Or if you want to play the sound and stop it after 300 ms (in my case, you should hear something for 30 ms, and there's 270 ms of silence):
mySoundBuffer.Play
Sleep 300
mySoundBuffer.Stop

Hatchekeeday! (for English people who like to learn the epitome of Dutch non-words)
Mich


Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology


-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of David McFarlane
Sent: 18 May 2010 23:43
To: e-prime at googlegroups.com
Subject: Re: Button press during sound play

Melissa,

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 (although latest 
reports indicate more like 10 days) -- 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 ...

I don't see why you are having trouble with this, and I thought this 
had been answered in other threads.  Nevertheless, it seems to me 
that if you set the input mask of your SoundOut or Slide object to 
the appropriate value (usually "(same as duration)", but perhaps a 
value longer than Duration if using "extended input") and End Action 
to (none) then all should work in either EP1 or EP2 (I still find EP1 
a generally superior platform unless I really need Movies, etc.).

-- David McFarlane, Professional Faultfinder


>I am currently designing an experiment in which children are presented
>with sentences that are read as they appear on screen.  Then, a
>question appears and is read in a sound file, with two options of
>answers, and a key press to designate the chosen answer.  However, I
>am having trouble allowing the children to press a key (for my
>reaction time measure) while the sound file plays (if they have
>decided on the answer prior to the reading ending).  It seems to only
>permit an answer input after the sound file is complete, which isn't
>terribly helpful for reaction time data.  I have Eprime 1 now, though
>I am in the process of getting Eprime 2.
>
>I know this seems painfully simple, but I have read all of the
>information I have found online in attempting to solve it.  So far, I
>have had no luck.  Any advice would be very appreciated.  Thank you
>all!

-- 
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.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

-- 
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