[open] Background music stimuli with delay
Hi,
I'm doing an eye-tracking study where participants are asked to read pieces of text while listening to background music. However, what I need is that the music starts playing before the sentences are presented (e.g. 3 seconds before). How do I get this working? When I used the delay function it simply played the entire music file (about 30 seconds) before presenting the sentence.
I want music for e.g. seconds alone (blank screen) and then the sentence + the same music file as played before the delay.
Comments
Hello,
What did you specify as the duration in the
sampleritem? Normally it should work if you set it to the time you need to wait (3 seconds in your case). So removesoundand replace it by3000and you should be set. Your sound will continue to play until it is over in both cases.Does this help?
Eduard
Thank you! Worked perfectly !
Ola
Another problem has popped up. The sound file doesn't stop playing, so that when the next sentence appears the experiment simply adds another sound file. So in the end I have four different sound files playing at once.
Tried stopping the music using ENTER, but doesn't work.
Hi Ola,
Would setting the
stop atfeature of thesamplerto an appropriate value solve the issue? Say, after 30000 ms.No cause the participants should be allowed to read the sentence for as long as they want, so needs to be a button they push or canvas change. I only want the music to play during the sentence and not the question.
Currently what I have for my sampler:
set duration "3000"
set fade_in "0"
set pan "0"
set pitch "1"
set sample "[Noise]"
set stop_at "ENTER" .... this doesn't work though
set volume "1"
Hi Ola,
Did you use an inline script to control your sound? (if not, see http://osdoc.cogsci.nl/python/sampler/)
If you have created a sound item just like you would create a canvas, the sound should be stopped simply by your_sound.stop(). You present the sentence in the run phase of your inline_script, after which you enter a while loop (e.g.
while button_pressed == false). After the while loop you place the sound.stop() command - I think that should do the trick?Cheers,
Josh
I am currently not. Just using the sampler item as my different noise conditions are the variables of the the experiment. But could I make a inline script like this:
src = [Noise] and then continue the script?
Noise includes my four sound conditions
I am facing the same problem as Ola. Could anybody please lend us a hand?