# Looping with loadSound()

**URL:** <https://forum.kirupa.com/t/looping-with-loadsound/181396>\
**Category:** Uncategorized\
**Created:** [March 8, 2006, 9:37pm UTC](https://forum.kirupa.com/t/looping-with-loadsound/181396 "2006-03-08T21:37:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyromunky](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@pyromunky](https://forum.kirupa.com/u/pyromunky)\
**Post date:** [March 8, 2006, 9:37pm UTC](https://forum.kirupa.com/t/looping-with-loadsound/181396/1 "2006-03-08T21:37:55Z")

</div>

I’m streaming the background audio on a site using the loadSound() command in the script below. It loops fine, but it’s volume goes back to default instead of setting to the variable I’ve used to record the current volume. I realize the code’s not working because the sound’s already begun and the function is no longer being called. But I can’t think of another way to reset the voulme once the next instance begins. Anyone have any suggestions?

```auto

audioTrack.onSoundComplete = function() {
    audioTrack.loadSound("soul.mp3", true);
    audiotrack.setVolume(_global.masterVol);
};

```
