# Load or extract local sound

**URL:** https://forum.kirupa.com/t/load-or-extract-local-sound/332636
**Category:** Uncategorized
**Created:** [August 31, 2014, 2:39am UTC](https://forum.kirupa.com/t/load-or-extract-local-sound/332636 "2014-08-31T02:39:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mcalloway](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mcalloway](https://forum.kirupa.com/u/mcalloway)
#### Post date: [August 31, 2014, 2:39am UTC](https://forum.kirupa.com/t/load-or-extract-local-sound/332636/1 "2014-08-31T02:39:44Z")

</div>

I need to change the pitch of a local library sound rather than a URL. Here is part of Andre Michelle’s code which does it for a URL. (extraneous code missing)

function playString( myString: String )  
{  
\_target = new ByteArray();  
SoundMixer.stopAll();  
pitchSound = new Sound();  
pitchSound.addEventListener( Event.COMPLETE, complete );  
pitchSound.load( new URLRequest(myString) );  
\_position = 0.0;  
\_sound = new Sound();  
\_sound.addEventListener( SampleDataEvent.SAMPLE\_DATA, sampleData );  
}  
//more code  
function sampleData( event: SampleDataEvent ):void  
{  
var read:int = pitchSound.extract(\_target,need,positionInt);  
}
