# Issue with playing same sound/video repeatedly in a trial

**URL:** <https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95>\
**Category:** Support\
**Created:** [November 23, 2021, 2:37pm UTC](https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95 "2021-11-23T14:37:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [November 23, 2021, 2:37pm UTC](https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95/1 "2021-11-23T14:37:35Z")

</div>

Hi Chris,

I tried to make a little script that pings the visual or auditory system with a flashing stimulus or sound. Works fine for the image but not for the movie/sound.

- In the first trial, if I have eg 8 presentations but only 3 stimuli, it will display the first 3 stimuli and then only the photodiode after. It has correct indexing into the group of sound files though.
- with (and only with) Load or unload stimulus commands, a single stimulus is then played for the following trials instead of the desired e.g. 8. Otherwise no stimulus at all is played after the initial trials.
- I am assuming this is related to some caching issues since the code is still happily displaying the photodiode image stimulus and a similar code with a visual stimulus works.
- I tried deferred yes no and explicit, and loading/unloading at hopefully the right locations, to no avail.
- If I turn alpha\_multiplier to 1, I can see that the visual part of the (static) movie is still shown, there’s just no tone. Is it not reset? Setting the repeats variable to some higher value doesn’t change anything either. Does it lose the volume setting and set it back to default off perhaps?
- I attached the code, set eye\_in\_window to true to run.
- Yoon mentioned he remembers he ran into a similar issue before

Thanks

Alina

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [November 23, 2021, 3:26pm UTC](https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95/2 "2021-11-23T15:26:04Z")

</div>

Hi Alina,

I’m not seeing this issue. When I run your audio\_only protocol with eye\_in\_window set to true, I consistently hear eight sounds per trial. If I remove the load/unload actions, the behavior remains the same. I tried throwing in some simulated broken fixations, in case there was an error in the failure-handling states, but everything seems to work correctly.

Can I ask what version of MWorks you’re running? I tested on the current nightly build.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [November 23, 2021, 7:22pm UTC](https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95/3 "2021-11-23T19:22:27Z")

</div>

I’m running on 0.11dev. It occurs both with laptop and headphone audio btw. I guess I should try the nightly build then.

Random thought: do the mwork behavioral files that are written always have information on the version it was ran on?

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [November 23, 2021, 9:26pm UTC](https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95/4 "2021-11-23T21:26:00Z")

</div>

> I’m running on 0.11dev. It occurs both with laptop and headphone audio btw. I guess I should try the nightly build then.

You are running a nightly, but maybe not a recent one. What is the date stamp? For example, the latest nightly would have today’s date (“Version 0.11.dev (2021.11.23)”).

Also, what version of macOS are you running on?

> Random thought: do the mwork behavioral files that are written always have information on the version it was ran on?

Yes, the version is announced in a message, and all messages are recorded to the event file. The message looks like this:

```
Running MWorks 0.11.dev (2021.11.23)

```

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 8, 2021, 6:46pm UTC](https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95/5 "2021-12-08T18:46:18Z")

</div>

Problem is indeed resolved with the latest nightly build 

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [December 9, 2021, 3:19pm UTC](https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95/6 "2021-12-09T15:19:00Z")

</div>

Great! Thanks for letting me know.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 6:36pm UTC](https://mworks.discourse.group/t/issue-with-playing-same-sound-video-repeatedly-in-a-trial/95/7 "2022-07-19T18:36:41Z")

</div>

Closed on July 19, 2022, 6:36pm UTC


