# Wakefield's Daily Tips

**URL:** <https://discourse.psychopy.org/t/wakefields-daily-tips/43371>\
**Category:** Blog\
**Tags:** online, pavlovia\
**Created:** [January 1, 2025, 3:36pm UTC](https://discourse.psychopy.org/t/wakefields-daily-tips/43371 "2025-01-01T15:36:55Z")\
**Posts on this page:** 1\
**Showing post:** 66

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [March 6, 2025, 10:52am UTC](https://discourse.psychopy.org/t/wakefields-daily-tips/43371/66 "2025-03-06T10:52:21Z")

</div>

## Sound components should start after the routine has started

If you are playing sounds online, then I would recommend setting the start time of any sound files in loops at .1 seconds or later. Since 2023.2 sounds often fail to play online after the first iteration of a loop. It seems to be that if the sound isn’t ready when it is supposed to start it “misses the boat”.

If your sound component has a start condition then I would recommend adding a time component to it. For example:  
**Begin Routine**

```auto
playSound = False

```

**Each Frame**

```auto
if not playSound and t > .1 and showAudio:
     playSound = True

```

Then use playSound as the start condition instead of showAudio (in this example).

Larger sound files may need longer to load, in which case it would be worth including an ITI at the start of the trial routine (rather than having it as a separate routine, which is my usual approach).

> [@Sound component with empty duration won't play after first iteration of loop—changed behavior in 2023.2.0](https://discourse.psychopy.org/t/sound-component-with-empty-duration-wont-play-after-first-iteration-of-loop-changed-behavior-in-2023-2-0/35974):
>
> I recently installed the standalone package of 2023.2.0 (on a Mac), and have an issue that wasn’t present in 2023.1.3. The experiment loops over a single trial routine. In that routine is a sound component trial\_beep that has a specified time (s) Start time, and an empty Stop time. (There’s also a text component and a keyboard component) In 2023.2.0, the sound trial\_beep plays on the first iteration of the loop, but no sound plays on any subsequent iterations of the loop.…

Another solution is to load the audio file in a static period in an earlier routine (within the loop).

---

_[View the full topic](https://discourse.psychopy.org/t/wakefields-daily-tips/43371)._
