# Sounds set in code do not play on Pavlovia

**URL:** <https://discourse.psychopy.org/t/sounds-set-in-code-do-not-play-on-pavlovia/46545>\
**Category:** Online experiments\
**Created:** [February 6, 2026, 10:52pm UTC](https://discourse.psychopy.org/t/sounds-set-in-code-do-not-play-on-pavlovia/46545 "2026-02-06T22:52:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 7, 2026, 9:34pm UTC](https://discourse.psychopy.org/t/sounds-set-in-code-do-not-play-on-pavlovia/46545/2 "2026-02-07T21:34:19Z")

</div>

Please could you clarify the stop condition for audio 1? I’ve just added a second audio to my sound test

> **[sound-test \[PsychoPy\]](https://run.pavlovia.org/Wake/sound-test/)**

sound\_2 start condition is sound\_1.status == FINISHED (start time .1 seconds)

Timeout in routine settings is sound\_2.status == FINISHED

These are just sound components with no code. However, I also have a replay sound [online demo](https://discourse.psychopy.org/t/psychopy-online-demos/22319) which plays two sounds repeatedly in code.

## Replay | [code](https://gitlab.pavlovia.org/vespr/replay) | [try it](https://run.pavlovia.org/vespr/replay) | [discussion thread](https://discourse.psychopy.org/t/paired-comparison-forced-choice-task-using-audio-stimuli/46238/)

Two audio files are loaded into two sound components during the ITI, but played with zero volume. During the trial routine, buttons are used to play the sound files. Once both audio files have been selected at least once, the trial can be ended with a forced choice. In this demo the pairs are fixed, but independent randomisation could be used if desired.

I never create sound objects in code.

---

_[View the full topic](https://discourse.psychopy.org/t/sounds-set-in-code-do-not-play-on-pavlovia/46545)._
