| Reference | Downloads | Github

How to adjust the volume of a movie compoent

Hi there,

I am looking for a way to adjust the volume of a movie component (using the builder, but the experiment needs to run online). While the documentation of Psychopy actually says that the tab “Playback” can be used to define how the stimulus should play (speed, volume, etc.) I cannot find a parameter for it.
What I need: The volume of the movie needs to have an individually adjusted value @Becca already helped me with in this post, so maybe you could help me with this, too?!
Ideas so far: I think that it will proably work with a code component that e.g., says mov.volume = thisVol, but I am not sure where to put the code (e.g. begin routine) and if the actual movie component just “takes” the value from the code component? Or do I have to add the whole movie part as a code component and if I do, how to I take care that it occurs at the right time and changes with each trial?

A little detail about my experiement: The movie component is part of a trial, comprising a black screen, a fixation cross and the movie. Within each trial the movie changes in accordance with a file path in an xcel file.
The experiment is going to be a fear conditioning task, which is why it is so important that the movie has the volume that was rated to be aversive in the beginning.

Thank you for your help!

Hi There! which version of psychopy are you using? you could indeed use a similar approach and then set the volume of the movie in a code component using movie.volume = thisVol - I think you would be correct to put that in the begin routine tab :slight_smile:

Hi Becca,
thanks for the reply! :slight_smile:

I’m using the builder version v2021.1.4. I couldn’t try it out yet. When I do, does the code component has to be at the very top or do I have to put it right before the Movie Component?