psychopy.org | Reference | Downloads | Github

'sound.getDuration()' not working

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Windows 7
PsychoPy version (e.g. 1.84.x): 1.83.0
**Standard Standalone? Y
What are you trying to achieve?:
I want the mouse to get activated only after the sound has completed playing.
What did you try to make it work?:
I used a ‘sound.getDuration()’ and selected ‘Condition’ instead of time(s).
What specifically went wrong when you tried that?:
This still doesn’t stop the mouse from getting activated right from the beginning of the trial.

Can anybody locate the problem in this?

I have tried all possibilities but doesn’t work. Is there another elegant way to start the mouse only after sound has completed playing? Note the sound is not of fixed length.

I have a code component for Mouse click recording, attached here. See if anything within code can be altered to achieve this.

Thanks

Is the mouse component below the sound component? That ensures it will get the duration of the current sound file rather than a previous one.

Yes it is -the mouse component is below sound

Any other thought ??

Thanks

put a $ sign before sound…

$sound_2.getDuration()