Error with variable stimuli offset

Hey Michael,

I appreciate the quick response. I added the “soundcomponent.status == FINISHED” to the stop value of the fixation stimulus, but this did not solve the error. You stated that the sound component should not need a duration value; however, when I leave it empty I receive this error: (ValueError: could not convert string to float: None). If I enter an arbitrary value for the stop duration (e.g., 10 s), the program will run. The problem with this is that I need the offset of the routine with the audio component to be dependent on the actual audio file duration (which vary from 8-ish to 12-ish s). The only reason I attempted to use the “$Duration” and “SoundFile.getDuration()” solutions was because leaving the audio component duration blank led to the error (ValueError: could not convert string to float: None).

I believe Dawid_Czech had a similar issue (Problem with the offset of a sound component) to which dvbrigdes provided a solution. The problem is that I am not sure how to implement his coding solution in the builder viewer.

Thanks for the help,

J