# Looping external mp3 file

**URL:** <https://forum.kirupa.com/t/looping-external-mp3-file/195345>\
**Category:** Uncategorized\
**Created:** [July 31, 2006, 4:04am UTC](https://forum.kirupa.com/t/looping-external-mp3-file/195345 "2006-07-31T04:04:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![telemetrik](https://avatars.discourse-cdn.com/v4/letter/t/dfb087/32.png) [@telemetrik](https://forum.kirupa.com/u/telemetrik)\
**Post date:** [July 31, 2006, 4:04am UTC](https://forum.kirupa.com/t/looping-external-mp3-file/195345/1 "2006-07-31T04:04:46Z")

</div>

hello all!

need some help figuring out how to make my external streaming mp3 file loop. I tried a few things but i’m having no luck. here is my code where everything works fine now minus the code for looping.

thanks for looking.

houston

playList = [“url”];

currentSong = 0;  
maxSongs = playList.length -1;

function startStreaming(){  
mp3 = new Sound();  
mp3.loadSound(playList[currentSong], true);  
mp3.onSoundComplete = function(){

```
        currentSong ++;
        if (currentSong &gt; maxSongs){
            currentSong = 0;}
            
        delete mp3; 
        
        }

```

}

startStreaming();  
stop();  
stop();
