# Random sound load and start is speeding up the sound. Any help?

**URL:** <https://forum.kirupa.com/t/random-sound-load-and-start-is-speeding-up-the-sound-any-help/172691>\
**Category:** Uncategorized\
**Created:** [December 16, 2005, 9:50pm UTC](https://forum.kirupa.com/t/random-sound-load-and-start-is-speeding-up-the-sound-any-help/172691 "2005-12-16T21:50:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![radioruin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/radioruin/32/2014_2.png) [@radioruin](https://forum.kirupa.com/u/radioruin)\
**Post date:** [December 16, 2005, 9:50pm UTC](https://forum.kirupa.com/t/random-sound-load-and-start-is-speeding-up-the-sound-any-help/172691/1 "2005-12-16T21:50:10Z")

</div>

Hello,

My first post here at Kirupa. I thought I’d give it a try.  
I’m trying to load sound dynamically into a clip and then play it randomly. The AS I came up with works great if the sound is embedded and I use the .attachSound() method instead of loadSound(). Now, when I load it dynamically and use the code below, the sound plays very fast and at a higher pitch.

I’m new to AS. Any help or insight into the issue would be much appreciated!

Thanks everyone!

```auto

var crows = new Sound(this);
	crows.loadSound("Raven.mp3", false);
	crows.setVolume(100);
rNum = function(){
	var i = 0;
	var randNum = Math.round(Math.random()*500);
	if (i>=randNum) {
		crows.start(0, 1);
	}
};
randSound = setInterval(rNum, 100);

```
