Pausing SlideSoundOut with spacebar Press
Hi,
I’ve designed an experiment where a visual and auditory stimulus are combined in a slide. I need the visual stimulus to disappear and the sound stimulus to stop playing with spacebar press (and reappear with subsequent spacebar press), and to log the number of spacebar presses. Participants should be able to toggle these stimuli as many times as they want during a 12 second period, after which the slide terminates. I have implemented code in an in-line object for this as follows:
Dim StimulusState As SlideState
Set StimulusState = StimulusDisabledControls.States("Default")
DISABLED_RT = StimulusDisabledControls.RT
Dim StimulusImage As SlideImage
Set StimulusImage = CSlideImage(StimulusState.Objects("Stimulus"))
Dim StimulusAudio As SlideSoundOut
Set StimulusAudio = CSlideSoundOut(StimulusState.Objects("aStim"))
If StimulusDisabledControls.InputMasks.Item(1).Responses.Count > 0 Then
If StimulusImage.Width = "0%" Then
StimulusImage.Width = "100%"
StimulusAudio.Play
StimulusAudio.ActiveBuffer.Play
SpacebarCount = SpacebarCount + 1
WritePort &H378, SPACEBAR_PRESS
sleep 20
WritePort &H378, 0
Else
StimulusImage.Width = "0%"
StimulusAudio.Stop
StimulusAudio.ActiveBuffer.Stop
SpacebarCount = SpacebarCount + 1
WritePort &H378, SPACEBAR_PRESS
sleep 20
WritePort &H378, 0
End If
GoTo StimulusDisabledContinue
End If
(For refrence: Stimulus = Visual stimulus, aStim = Auditory Stimulus, StimulusDisabledContinue = a label in the procedure)
This works fine for the visual stimulus, but not the auditory stimulus. The error message I’m getting is that Play is not an assignable method of the object. If I comment out that line, it also does not seem to stop the auditory stimulus playing with the later command. Does anybody know why that is, or could they point me down a better route for what I’m trying to do? Thank you!
Haydn.
Please sign in to leave a comment.
Comments
0 comments