# Issues when playing audio with condition specified for every repeat

**URL:** https://discourse.psychopy.org/t/issues-when-playing-audio-with-condition-specified-for-every-repeat/35708
**Category:** Online experiments
**Tags:** sound
**Created:** [July 13, 2023, 12:04pm UTC](https://discourse.psychopy.org/t/issues-when-playing-audio-with-condition-specified-for-every-repeat/35708 "2023-07-13T12:04:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Xiaoyue](https://avatars.discourse-cdn.com/v4/letter/x/3be4f8/32.png) [@Xiaoyue](https://discourse.psychopy.org/u/Xiaoyue)
#### Post date: [July 13, 2023, 12:04pm UTC](https://discourse.psychopy.org/t/issues-when-playing-audio-with-condition-specified-for-every-repeat/35708/1 "2023-07-13T12:04:50Z")

</div>

Hi there,  
I’m trying to get familiar with pavlovia and creating a demo that uses sound component, but run into a frustrating bug.

The whole procedure of the demo should be like this: in each trial, a pure tone specified by code component is played with a corresponding picture shown, and the participant should press a key (‘up’/‘down’/‘right’/‘left’) as a response. After the response, it will enter the next trial.

Everything goes well when I run it offline in Builder, but a problem pops up when I try to play it on a browser (using Edge and Firefox). That is, only the tone in 1st trial goes well, but tones in later trials are either not played or replaced by a beep (much shorter than what the tones should be). I tried to specify conditions by xlsx file rather than code component, but the result wasn’t changed.

Later I also tried to fix the tone and corresponding picture as constant, then the problem is sorted, tones sound well. Consequently, I assume the problem may be related to the file-loading process, considering no further loading is needed if stimuli are fixed? Do anyone have idea to sort this problem? Any help would be appreciated!

Xiaoyue

---

<div class="post-metadata">

### Author: ![Xiaoyue](https://avatars.discourse-cdn.com/v4/letter/x/3be4f8/32.png) [@Xiaoyue](https://discourse.psychopy.org/u/Xiaoyue)
#### Post date: [July 13, 2023, 12:07pm UTC](https://discourse.psychopy.org/t/issues-when-playing-audio-with-condition-specified-for-every-repeat/35708/2 "2023-07-13T12:07:06Z")

</div>

Also add some info: All the sounds are in wav format, and no error message pops up.
