#1
|
|||
|
|||
playing a sound multiple times at different timings
Dear all,
I am new to Vizard and to programming in general. I need to use it to program an experiment for my studies and while I have already done a number of tutorials, I still feel quite insecure. I wanted to ask for your help with the following: I am trying to create a function that will basically call my trial (displaying two 2D pictures on the screen and playing some sounds). Because I got stuck at the sounds part, I started a new Vizard file just for the sound to try out different things. I want the sound to play 10 times. I figured a loop should do the trick, but I can't seemt o find a way to do that...I've looked at sound.loop(viz.ON) and at viz.playSound('pip.wav', viz.LOOP) but these are endless loops. Here is what I have so far: #stimulus pip = viz.addAudio('pip.wav') #Import Vizard modules: import viz import time import viztask import vizact #Start viz.go() #Sounds cue = 1 while cue <= 10: pip.play() # This should be executed 10 times #viz.playSound('pip.wav') cue += 1 But this doesn't play the sound 10 times...Not to mention that, ideally, I would want the sound to play at randomly intersperced intervals until the last (10th) sound is played. But that will be my next challenge. First, I need to figure out how to play the sound 10 times. I would be really greatful for any pointers in the right direction! Thank you very much in advance! Jelly |
Tags |
sound loop |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
preEuler not working? or how to teleport subject multiple times | ichitaka | Precision Position Tracker (PPT) | 1 | 12-19-2015 03:27 AM |
output to multiple (two) sound devices | GiudiceLab | Vizard | 1 | 08-05-2009 01:12 PM |
Multiple Sound Devices | GiudiceLab | Vizard | 2 | 06-06-2009 10:29 AM |
how can I detect when a sound finished playing? | bernie | Vizard | 3 | 05-10-2007 06:08 PM |
Error when playing wav files...? | vjonshih | Vizard | 1 | 05-23-2005 12:21 PM |